02/15/2019 at 11:14 am
#484736
Keymaster
@ Janet
RE: But I think everything is ingmored if you press Enter instead of Submit.
Why is that?
The javascript should prevent even the entry key as the form can not be submitted unless the if statements becomes true.
If you find that is not the case, then perhaps adding prevent default will help???
$('#cn-cat-select').submit(function(event) {
event.preventDefault();
if ( $.trim($("#cnmcs-address-input").val()) === "" ) {
alert('You did not fill out the postcode field.');
return false;
}
});
