Check input of form field - if postcode exists, alert javascript -
need append script text field in 'enter postcode' field, actively check content , pop alert. blacklisting postcodes, basically.
here have:
html:
<input type="text" maxlength="20" size="25" value="" name="zipc" id="zipc">
js:
jquery("#zipc").ready(function () { function bfpo(t) { if (t.value.match(/\"bf1 3aa"/g)) { alert('we cannot send parcels bfpo addresses. ever.'); t.value = t.value.replace(/\s/g,''); } } });
now, i'm aware doesn't work how 'ready' alert when select next field type in? perhaps use of indexof()?
any great , in advance.
i think can use focusout function. check out
and can use blur() function well
$('#textfieldid').blur(function() { //logic });
Comments
Post a Comment