load.html 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Load Form Data - jQuery EasyUI Demo</title>
  6. <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
  7. <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
  8. <link rel="stylesheet" type="text/css" href="../demo.css">
  9. <script type="text/javascript" src="../../jquery.min.js"></script>
  10. <script type="text/javascript" src="../../jquery.easyui.min.js"></script>
  11. </head>
  12. <body>
  13. <h2>Load Form Data</h2>
  14. <p>Click the buttons below to load form data.</p>
  15. <div style="margin:20px 0;">
  16. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="loadLocal()">LoadLocal</a>
  17. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="loadRemote()">LoadRemote</a>
  18. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()">Clear</a>
  19. </div>
  20. <div class="easyui-panel" title="New Topic" style="width:100%;max-width:400px;padding:30px 60px;">
  21. <form id="ff" method="post">
  22. <div style="margin-bottom:20px">
  23. <input class="easyui-textbox" name="name" style="width:100%" data-options="label:'Name:',required:true">
  24. </div>
  25. <div style="margin-bottom:20px">
  26. <input class="easyui-textbox" name="email" style="width:100%" data-options="label:'Email:',required:true,validType:'email'">
  27. </div>
  28. <div style="margin-bottom:20px">
  29. <input class="easyui-textbox" name="subject" style="width:100%" data-options="label:'Subject:',required:true">
  30. </div>
  31. <div style="margin-bottom:20px">
  32. <input class="easyui-textbox" name="message" style="width:100%;height:60px" data-options="label:'Message:',multiline:true">
  33. </div>
  34. <div style="margin-bottom:20px">
  35. <select class="easyui-combobox" name="language" label="Language" style="width:100%"><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>
  36. </div>
  37. <div style="margin-bottom:20px">
  38. <label for="accept" class="textbox-label">Accept:</label>
  39. <input id="accept" type="checkbox" name="accept" value="true">
  40. </div>
  41. </form>
  42. </div>
  43. <script>
  44. function loadLocal(){
  45. $('#ff').form('load',{
  46. name:'myname',
  47. email:'mymail@gmail.com',
  48. subject:'subject',
  49. message:'message',
  50. language:'en',
  51. accept:true
  52. });
  53. }
  54. function loadRemote(){
  55. $('#ff').form('load', 'form_data1.json');
  56. }
  57. function clearForm(){
  58. $('#ff').form('clear');
  59. }
  60. </script>
  61. </body>
  62. </html>