Response title
This is preview!
$(function(){
// register submit event of the form.
$('form.numberValidator').submit(function(){
// check the value of the input field.
if ($('input[name="number"]').val() < 20) {
alert('The number entered is less than 20.');
return false; // prevent form submission.
}
});
});
<html>
<body>
<form class="numberValidator">
<input type="text" name="number" />
<button type="submit">Submit</button>
</form>
</body>
</html>
espiculo wrote:hello
I want to validate an input field so he accepts numeric value greater than 20 ..
person type number is less than 20 open an alert is to do this with jquery?
© 2013 jQuery Foundation
Sponsored by and others.