<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Basic Form - jQuery EasyUI Demo</title> <link type="text/css" href="https://www.jb51.net/themes/default/easyui.css"> <link type="text/css" href="https://www.jb51.net/themes/icon.css"> <link type="text/css" href="https://www.jb51.net/demo.css"> <script type="text/javascript" src="https://www.jb51.net/jquery.min.js"></script> <script type="text/javascript" src="https://www.jb51.net/jquery.easyui.min.js"></script> </head> <body> <h2>基本表单</h2> <p>Fill the form and submit it.</p> <div></div> <div title="新主题"> <div> <form method="post"> <table cellpadding="5"> <tr> <td>姓名:</td> <td><input type="text" data-options="required:true"></input></td> </tr> <tr> <td>邮件:</td> <td><input type="text" data-options="required:true,validType:'email'"></input></td> </tr> <tr> <td>主题:</td> <td><input type="text" data-options="required:true"></input></td> </tr> <tr> <td>消息:</td> <td><input data-options="multiline:true"></input></td> </tr> <tr> <td>语言:</td> <td> <select><option value="ar">Arabic</option><option value="bg">Bulgarian</option><option value="ca">Catalan</option><option value="zh-cht">Chinese Traditional</option><option value="cs">Czech</option><option value="da">Danish</option><option value="nl">Dutch</option><option value="en" selected="selected">English</option><option value="et">Estonian</option><option value="fi">Finnish</option><option value="fr">French</option><option value="de">German</option><option value="el">Greek</option><option value="ht">Haitian Creole</option><option value="he">Hebrew</option><option value="hi">Hindi</option><option value="mww">Hmong Daw</option><option value="hu">Hungarian</option><option value="id">Indonesian</option><option value="it">Italian</option><option value="ja">Japanese</option><option value="ko">Korean</option><option value="lv">Latvian</option><option value="lt">Lithuanian</option><option value="no">Norwegian</option><option value="fa">Persian</option><option value="pl">Polish</option><option value="pt">Portuguese</option><option value="ro">Romanian</option><option value="ru">Russian</option><option value="sk">Slovak</option><option value="sl">Slovenian</option><option value="es">Spanish</option><option value="sv">Swedish</option><option value="th">Thai</option><option value="tr">Turkish</option><option value="uk">Ukrainian</option><option value="vi">Vietnamese</option></select> </td> </tr> </table> </form> <div> <a href="javascript:void(0)">提交</a> <a href="javascript:void(0)">清除</a> </div> </div> </div> <script> function submitForm(){ $('#ff').form('submit'); } function clearForm(){ $('#ff').form('clear'); } </script> </body> </html>
Jquery组件easyUi实现表单验证示例
内容版权声明:除非注明,否则皆为本站原创文章。