Guest User

Untitled

a guest
Jan 22nd, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <title></title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. <script type="text/javascript" src="dojo/dojo.js" djConfig="parseOnLoad:true, isDebug:true"></script>
  7. <style type="text/css">
  8. @import "dojo/resources/dojo.css";
  9. @import "dijit/themes/tundra/tundra.css";
  10. </style>
  11. <script type="text/javascript">
  12. dojo.require("dojo.parser");
  13. dojo.require("dijit.form.Form");
  14. dojo.require("dijit.form.FilteringSelect");
  15. dojo.require("dijit.form.ValidationTextBox");
  16. dojo.require("dojo.data.ItemFileReadStore");
  17. dojo.require("dijit.form.Button");
  18. </script>
  19. </head>
  20. <body class="tundra">
  21. <div dojoType="dijit.form.Form" id="form" jsId="form" name="form" validate(); encType="multipart/form-data" action="" method="">
  22. <table>
  23. <tr>
  24. <td>
  25. <label>*Поле1:</label>
  26. </td>
  27. <td>
  28. <input dojoType="dijit.form.FilteringSelect" searchAttr="name" id="selectField" required="true">
  29. </td>
  30. </tr>
  31. <tr>
  32. <td>
  33. <label>*Поле2:</label>
  34. </td>
  35. <td>
  36. <input dojoType="dijit.form.ValidationTextBox" type="text" id="textField" name="textField" minLength="1" trim="true" required="true" style="width: 10em;"/>
  37. </td>
  38. </tr>
  39. <tr>
  40. <td colspan="2" align="center">
  41. <button dojoType="dijit.form.Button" type="button" id="buttonSave" style="margin-right:5px;" disabled>Сохранить</button>
  42. <button dojoType="dijit.form.Button" type="reset">Очистить</button>
  43. </td>
  44. </tr>
  45. </table>
  46. </div>
  47. </body>
  48. <script type="text/javascript">
  49. dojo.addOnLoad(function(){
  50. dojo.connect(dijit.byId("form"), "onValidStateChange",function(isValid) {
  51. dijit.byId("buttonSave").set("disabled",!isValid);
  52. });
  53. var store = new dojo.data.ItemFileReadStore({data: {items: [{"id":"1","name":"как не крути"},{"id":"2","name":"заполняется"}], identifier:"id", label:"name"}});
  54. dijit.byId("selectField").set("store", store);
  55. });
  56. </script>
  57. </html>
Add Comment
Please, Sign In to add comment