鏃ュ織鏍囩锛歠orm

windsformvalid-琛ㄥ崟楠岃瘉JQuery鎻掍欢

鍒嗙被锛JQuery鎻掍欢璇勮锛0鏉浣滆咃細awinds鏃ユ湡锛2012-07-24闃呰锛45,010 views

婕旂ず椤甸潰锛歨ttp://www.lijian.net/p/windsformvalid/ 姣忔琛ㄥ崟姣忎釜椤甸潰鎻愪氦閮借鑷繁鍐欒剼鏈獙璇佷俊鎭紝鑰佹槸澶嶅埗绮樿创鐨勫緢鐑︼紝鏀硅捣鏉ヤ篃寰堥夯鐑︼紝缃戜笂涔熸湁澶ф妸鐨勮〃鍗曢獙璇佹彃浠讹紝浣嗘槸鎰熻鐢ㄨ捣鏉ヤ笉鐏垫椿锛岃繖灏卞嚭鐜颁簡windsformvalid.   浣跨敤鏂规硶锛 1銆佸紩鐢╦query鍜寃indsformvalid.js <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script> <script src="js/jquery.windformvalid.js" type="text/javascript"></script> 2銆侀氳繃rule灞炴х粰鎺т欢澧炲姞楠岃瘉瑙勫垯锛屽涓鍒欏垯鐢”|”鍒嗗紑锛屽鐢ㄦ埛鍚嶏細 <input type="text" class="input longtext" id="txtlogin" name="txtlogin" rule="nonull|username|5-18|ajax" ajaxurl="ajax/valid.php" nullmsg="鐢ㄦ埛鍚嶄笉鑳戒负绌!" errormsg="鐢ㄦ埛鍚嶆牸寮忎笉姝g‘!" /> rule鐨勫间负鍑犵楠岃瘉瑙勫垯绫诲瀷锛 鐗瑰緛瑙勫垯锛 nonull:涓嶈兘涓虹┖ define:鑷畾涔夎鍒欙紝褰撲娇鐢╠efine瑙勫垯鏃讹紝蹇呴』缁欐帶浠跺鍔燿efine灞炴э紝濡傦細 <input type="text" id="txtdefine" name="txtdefine" class="input longtext" rule="define" define="/^hello[0-9]+$/" errormsg="鑷畾涔夎鍒欐牸鈥