李炎恢_PHP_jQuery EasyUI[023] ~ ValidateBox(驗證框)組件
李炎恢_PHP_jQuery EasyUI[023] ~ ValidateBox(驗證框)組件
參考資料: https://github.com/jash-git/jash-WebSI
GITHUB: https://github.com/jash-git/richie_jQuery_EasyUI
My code:
$(function () { $.extend($.fn.validatebox.defaults.rules, { minLength : { validator : function (value, param) { return value.length >= param[0]; }, message : '请输入不小于{0}的字符', }, }); $('#email').validatebox({ required : true, validType : 'minLength[5,10]', //validType : 'url', //validType : 'length[2,10]', //validType : 'remote["content.php", "abc"]', //validType : ['email', 'length[5,10]'], //delay : 1000, //missingMessage : '请输入内容', //invalidMessage : '您输入的电子邮件格式不合法!', tipPosition : 'right', //deltaX : 100, //novalidate : true, }); //console.log($('#email').validatebox('options')); //$('#email').validatebox('destroy'); //$(document).click(function () { //console.log($('#email').validatebox('validate')); //console.log($('#email').validatebox('isValid')); //}); //$('#email').validatebox('disableValidation'); //$('#email').validatebox('enableValidation'); });
<?php if ($_POST['abc'] == 'Lee') { echo 'true'; } else { echo 'false'; } ?>
<!DOCTYPE html> <html> <head> <title>jQuery Easy UI</title> <meta charset="UTF-8" /> <script type="text/javascript" src="../../easyui_15/jquery.min.js"></script> <script type="text/javascript" src="../../easyui_15/jquery.easyui.min.js"></script> <script type="text/javascript" src="../../easyui_15/locale/easyui-lang-zh_TW.js" ></script> <script type="text/javascript" src="js/index.js"></script> <link rel="stylesheet" type="text/css" href="../../easyui_15/themes/default/easyui.css" /> <link rel="stylesheet" type="text/css" href="../../easyui_15/themes/icon.css" /> </head> <body style="margin-left:200px"> <!-- <input id="email" class="easyui-validatebox" data-options="required:true,validType:'email'" /> --> <input id="email" /> </body> </html> © 2021 GitHub, Inc.
PDF:
執行結果: