forms.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>Forms test</title>
  5. <meta charset="utf-8">
  6. <script src="bind.js"></script>
  7. <script src="../../../dist/seed.js"></script>
  8. </head>
  9. <body>
  10. <form id="forms">
  11. <input type="text" name="text" sd-model="text">
  12. <input type="checkbox" name="checkbox" sd-model="checked">
  13. <input type="radio" name="radio" sd-model="radio" value="a">
  14. <input type="radio" name="radio" sd-model="radio" value="b">
  15. <select sd-model="select" name="select">
  16. <option>a</option>
  17. <option>b</option>
  18. </select>
  19. <textarea name="textarea" sd-model="textarea"></textarea>
  20. </form>
  21. <div id="values">
  22. <p class="text">{{text}}</p>
  23. <p class="checkbox">{{checked}}</p>
  24. <p class="radio">{{radio}}</p>
  25. <p class="select">{{select}}</p>
  26. <p class="textarea">{{textarea}}</p>
  27. </div>
  28. <script>
  29. var test = new Seed({
  30. el: 'body',
  31. lazy: true,
  32. scope: {
  33. text: 'some text',
  34. checked: true,
  35. radio: 'b',
  36. select: 'b',
  37. textarea: 'more text'
  38. }
  39. })
  40. </script>
  41. </body>
  42. </html>