摘要:jQuery-輸入欄位的字元、型態限制
一套不錯用來限制input text 為文字or 數字的plug-in
外掛名稱:jQuery AlphaNumberic
來源網站:http://itgroup.com.ph/alphanumeric
使用參考:
API Functions:
- alphanumeric - allow both alphabet and numeric characters
- alpha - allow only alphabet characters
- numeric - allow only numeric characters
API Properties
- allow - add excempted characters to the rule of prevention
- ichars - define a custome set of characters to prevent
- allcaps - allow only capital letters to be entered
- nocaps - allow only lowercase characters to be entered
使用範例:
$(“.類別名稱”).alphanumeric(); 只能為字母/數字
$(“.類別名稱”).alpha({nocaps:true}); 只能為小寫字母
$(“.類別名稱”)).numeric(); 只能為數字