forms_test.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <!DOCTYPE html>
  2. <html>
  3. <!--
  4. Copyright 2006 The Closure Library Authors. All Rights Reserved.
  5. Use of this source code is governed by the Apache License, Version 2.0.
  6. See the COPYING file for details.
  7. -->
  8. <head>
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  10. <meta charset="UTF-8" />
  11. <title>Closure Unit Tests - goog.dom.forms</title>
  12. <script src="../base.js"></script>
  13. <script>
  14. goog.require('goog.dom.formsTest');
  15. </script>
  16. </head>
  17. <body>
  18. <!-- empty div to test against -->
  19. <div id="testdiv1"></div>
  20. <form id="testform1" action="https://foo.bar/baz" onsubmit="return false">
  21. <!-- text input with one value -->
  22. <input id="in1" name="in1" value="foo">
  23. <!-- text inputs with two values -->
  24. <input id="in2" name="in2" value="bar">
  25. <input id="in2" name="in2" value="baaz">
  26. <!-- empty text input -->
  27. <input id="in3" name="in3" value="">
  28. <!-- password -->
  29. <input id="pass" name="pass" type="password" value="bar">
  30. <!-- textarea -->
  31. <textarea id="textarea1" name="textarea">foo bar baz</textarea>
  32. <!-- select single -->
  33. <select id="select1" name="select1">
  34. <option value="1" selected>one</option>
  35. <option value="2">two</option>
  36. </select>
  37. <!-- select multiple -->
  38. <select id="select2" name="select2" multiple=true>
  39. <option value="a" selected>A</option>
  40. <option value="b">B</option>
  41. <option value="c" selected>C</option>
  42. </select>
  43. <!-- select no value -->
  44. <select id="select3" name="select3">
  45. <option></option>
  46. <option value="1">one</option>
  47. <option value="2">two</option>
  48. </select>
  49. <!-- checkboxes -->
  50. <fieldset id="testfieldset1">
  51. <legend id="testlegend1">Checkboxes</legend>
  52. <input id="checkbox1" type="checkbox" name="checkbox1" checked>
  53. <input id="checkbox2" type="checkbox" name="checkbox2">
  54. </fieldset>
  55. <!-- radio buttons -->
  56. <fieldset>
  57. <legend>Radio Buttons</legend>
  58. <input id="radio1" type="radio" name="radio" value="X" checked>
  59. <input id="radio2" type="radio" name="radio" value="Y">
  60. </fieldset>
  61. <fieldset>
  62. <legend>Radio Buttons</legend>
  63. <input id="radio3" type="radio" name="radio2" value="X">
  64. <input id="radio4" type="radio" name="radio2" value="Y" checked>
  65. </fieldset>
  66. <!-- button -->
  67. <button id="button" name="button" type="button" value="button" onclick="testSetValueSelectMultiple()">button</button>
  68. <!-- submit -->
  69. <input id="submit" type="submit" name="submit" value="submitv" formaction="https://foo.xyz/baz">
  70. <!-- reset -->
  71. <input id="reset" type="reset" name="reset" value="reset">
  72. <!-- submit -->
  73. <button id="submitb" name="submit" value="submitb" formaction="https://foo.xyz/baz">
  74. Submit
  75. </button>
  76. </form>
  77. <form id="testform2">
  78. <input type="file" name="file">
  79. </form>
  80. <form id="testform3">
  81. <!-- text input -->
  82. <input id="in4" name="in4">
  83. <!-- textarea -->
  84. <textarea id="textarea2" name="textarea"></textarea>
  85. <!-- select single -->
  86. <select id="select4" name="select1">
  87. <option value="1">one</option>
  88. <option value="2">two</option>
  89. </select>
  90. <!-- select multiple -->
  91. <select id="select5" name="select5" multiple=true>
  92. <option value="a">A</option>
  93. <option value="b">B</option>
  94. <option value="c">C</option>
  95. </select>
  96. <!-- radio -->
  97. <input id="radio3" type="radio" name="radio3" value="Z">
  98. <!-- checkbox -->
  99. <input id="checkbox2" type="checkbox" name="checkbox2">
  100. <!-- select multiple no value -->
  101. <select id="select6" name="select6" multiple=true>
  102. <option value="a">A</option>
  103. <option value="b">B</option>
  104. </select>
  105. <!-- select with empty value -->
  106. <select id="select7" name="select7">
  107. <option value="">Empty</option>
  108. <option value="a">A</option>
  109. <option value="b">B</option>
  110. </select>
  111. </form>
  112. <form id="testform4">
  113. <embed ></embed>
  114. <embed type="foo/bar"></embed>
  115. <object></object>
  116. </form>
  117. </body>
  118. </html>