I use this script daily and never had an issue before now. Ive been staring at it so long i can't find the issue. I have a form with an input, the input is required and has a minlength of 2. If you submit the form, it displays the "required" error message. If you enter one character and hit submit again, its adding another error message instead of changing between the two. Please help!This is using jquery.validate.js
<script type="text/javascript">
$(document).ready(function() {
$("#TTFirst").validate({
errorElement: "span",
errorPlacement: function(error, element) {
error.appendTo( element.parent("td"));
},
rules: {
license: {
required: true,
minlength: 2
}
},
messages: {
license: {
required: "Please Enter Your First Name",
minlength: "Must be at Least 2 Characters"
}
}
});
});
</script>
HTML
<table cellspacing="1" id="credits">
<form action="http://www.domain.com/dir/processor.php" method="post" id="TTFirst">
<table>
<tr class="odd">
<td width="500">
<label>$25 Transaction Credit for License </label>
<input type="text" name="license" />
</td>
<td width="50">$26.95</td>
<td width="150">
<input type="hidden" name="item_number" value="41">
<input type="submit" value="" class="orderNow" />
</td>
</tr>
</table>
</form>