I have a select list that's default value (for Please Select) is 0. this is due to the payment processing system and beyond my control. I have an add.Method that states if the select's value is "0" return false, otherwise return true. It works ok, except that when you change the select's value to something else after submitting and getting error, the error msg is still displayed. How do I fix this
the HTML:
<form action="" method="post" id="SinglePmnt">
<td>
<select name="technology" class="select" id="singleTech">
<option value="0" selected="selected"> Please Select</option>
<option value="Interactive Brokers"> Interactive Brokers</option>
<option value="MB Trading"> MB Trading</option>
<option value="Patsystems"> Patsystems</option>
<option value="PFG"> PFG (Peregrine Financial)</option>
<option value="TD AMERITRADE"> TD AMERITRADE</option>
<option value="Trading Technologies"> Trading Technologies</option>
<option value="Vision Financial Markets"> Vision Financial Markets</option>
<option value="Hosted"> Zen-Fire</option>
</select>
</td>
<td>Single Payment of $995</td>
<td>
<input type="hidden" name="item_number" value="34">
<input type="submit" value="" class="orderNow" />
</td>
</form>
the validation rule using jquery.validate.js
$(document).ready(function() {
$.validator.addMethod(
"SelectTechnology",
function(value, element) {
if ($("#singleTech").val() === '0'){
return false;
} else return true;
},
"Please Select a Technology"
);
var validator = $("#SinglePmnt").validate({
rules: {
technology: {
SelectTechnology: true
}
},
errorElement: "span",
errorPlacement: function(error, element) {
error.appendTo(element.parent("td"));
}
});
});
Can't see the error in this, I appreciate any help. thanks