jQuery-輸入欄位的字元、型態限制

摘要:jQuery-輸入欄位的字元、型態限制

一套不錯用來限制input text 為文字or 數字的plug-in

外掛名稱:jQuery AlphaNumberic

來源網站:http://itgroup.com.ph/alphanumeric

使用參考:

API Functions:

  1.      alphanumeric - allow both alphabet and numeric characters
  2.      alpha - allow only alphabet characters
  3.      numeric - allow only numeric characters

API Properties

  1.      allow - add excempted characters to the rule of prevention
  2.      ichars - define a custome set of characters to prevent
  3.      allcaps - allow only capital letters to be entered
  4.      nocaps - allow only lowercase characters to be entered

使用範例:
     $(“.類別名稱”).alphanumeric();  只能為字母/數字
     $(“.類別名稱”).alpha({nocaps:true});  只能為小寫字母
     $(“.類別名稱”)).numeric();  只能為數字