All pastes #559244 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-06-11 18:08 UTC
rendered paste body
the script doesnt work, its submits the form, please help, thanks in advance


SCRIPT language=JavaScript>

function validation() {
var textField = document.x1.x2
 if(textField.value.length < 12) { 
	alert('error!');
	return false;
    }
} 
//--></SCRIPT>

<form action="post.php" name="x1" onsubmit="validation()">
<INPUT TYPE="TEXT" MAXLENGTH="12" name="x2">
<input type="submit">
</FORM>