4
我想使用jQuery驗證郵政編碼字段,但它不起作用。jQuery郵政編碼驗證不起作用
這裏是我的代碼:
if (postcod.val().match ('~^([1-9]{1}[0-9]{3}\s[A-Z]{2})$~')){
}else{
postcod.addClass("needsfilled");
postcod.val(postcoderror);
}
這裏是HTML:
PostCode<br /><input id="postcod" type="text" value="" name="postcod" />
你能幫PLZ
什麼是郵政編碼期望的語法?在美國,除非您使用擴展名,否則您可以檢查它是否爲數字,介於0和99999之間,長度爲5個字符。 – dtbarne 2011-05-17 07:47:58