why isn't my validator working?
Posted
by Lina
on Stack Overflow
See other posts from Stack Overflow
or by Lina
Published on 2010-04-08T08:01:45Z
Indexed on
2010/04/08
8:23 UTC
Read the original article
Hit count: 389
jQuery
|validation
hi, can anybody tell me why is the following code not working?
<script type="text/javascript" src="../../Scripts/jquery.js"></script>
<script type="text/javascript" src="../../Scripts/jquery.validate.js"></script>
<script type="text/javascript">
$(function() {
// validate contact form on keyup and submit
$("#myform").validate({
//set the rules for the fild names
rules: {
hour: {
required: true,
minlength: 2,
range:[0,23]
},
minute: {
required: true,
minlength: 2,
range:[0,60]
},
},
//set messages to appear inline
messages: {
hour: "Please enter a valid hour",
minute: "Please enter a valid minute"
}
});
});
</script>
<style type="text/css">
.error {
color: red;
font: 12pt verdana;
padding-left: 10px
}
</style>
<form id="myform" method="" action="">
<input id="hour" type="text" name="hour" style="width:30px; text-align:center;"></input> :
<input id="minute" type="text" name="minute" style="width:30px; text-align:center;"></input>
<br/>
<input type="submit" value="Validate!" />
</form>
thanks a million in advance, Lina
© Stack Overflow or respective owner