I am using wordpress and trying to throw a message when the value for a text input is greater than 40..
<input type="text" name="quantity" size="2" value="<?php echo wpsc_cart_item_quantity(); ?>" />
Now i want to throw a message (alert) when this text field contains value greater than 40 and also want to reset its value to '' My wordpress theme uses jquery 1.71 I am doing the following:
jQuery("input[type='text'][name='quantity']").change(function() {
if (this.val >= 41) {
alert("To order quantity greater than 40 please use the contact form.");
this.val == '';
this.focus();
return false;
}
});
Thanks.