All pastes #559251 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-06-11 18:13 UTC
rendered paste body
<script type="text/javascript">
// Welcome to 2007
// Make sure your HTML is valid as well

function validation(f) {
var textField = f.elements['x2'];
 if(textField.value.length < 12) { 
	alert('error!');
	return false;
    }
return true;
} 
</script>

<form action="post.php" name="x1" onsubmit="return validation();">
<input type="text" maxlength="12" name="x2">
<input type="submit">
</form>