load.html 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. <div class="demo-info">
  15. <div class="demo-tip icon-tip"></div>
  16. <div>Click the buttons below to load form data.</div>
  17. </div>
  18. <div style="margin:10px 0;">
  19. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="loadLocal()">LoadLocal</a>
  20. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="loadRemote()">LoadRemote</a>
  21. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()">Clear</a>
  22. </div>
  23. <div class="easyui-panel" title="New Topic" style="width:400px">
  24. <div style="padding:10px 0 10px 60px">
  25. <form id="ff" method="post">
  26. <table>
  27. <tr>
  28. <td>Name:</td>
  29. <td><input class="easyui-validatebox" type="text" name="name" data-options="required:true"></input></td>
  30. </tr>
  31. <tr>
  32. <td>Email:</td>
  33. <td><input class="easyui-validatebox" type="text" name="email" data-options="required:true,validType:'email'"></input></td>
  34. </tr>
  35. <tr>
  36. <td>Subject:</td>
  37. <td><input class="easyui-validatebox" type="text" name="subject" data-options="required:true"></input></td>
  38. </tr>
  39. <tr>
  40. <td>Message:</td>
  41. <td><textarea name="message" style="height:60px;"></textarea></td>
  42. </tr>
  43. <tr>
  44. <td>Language:</td>
  45. <td>
  46. <select class="easyui-combobox" name="language"><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>
  47. </td>
  48. </tr>
  49. </table>
  50. </form>
  51. </div>
  52. </div>
  53. <script>
  54. function loadLocal(){
  55. $('#ff').form('load',{
  56. name:'myname',
  57. email:'mymail@gmail.com',
  58. subject:'subject',
  59. message:'message',
  60. language:'en'
  61. });
  62. }
  63. function loadRemote(){
  64. $('#ff').form('load', 'form_data1.json');
  65. }
  66. function clearForm(){
  67. $('#ff').form('clear');
  68. }
  69. </script>
  70. </body>
  71. </html>