submit.form.on.change.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {% comment %}
  2. Licensed to Cloudera, Inc. under one
  3. or more contributor license agreements. See the NOTICE file
  4. distributed with this work for additional information
  5. regarding copyright ownership. Cloudera, Inc. licenses this file
  6. to you under the Apache License, Version 2.0 (the
  7. "License"); you may not use this file except in compliance
  8. with the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. {% endcomment %}
  16. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
  17. <html>
  18. <head>
  19. <title>Submit Form on Change</title>
  20. </head>
  21. <body>
  22. {% if post_vars %}
  23. <div class="jframe_padded">
  24. You submitted the following values:
  25. <ul>
  26. {% for post_var, val in post_vars %}
  27. <li>{{post_var}}: {{val}}</li>
  28. {% endfor %}
  29. </ul>
  30. </div>
  31. {% else %}
  32. <p>
  33. The form below will submit as soon as you select a value.
  34. </p>
  35. <form action="/jframegallery/submit.form.on.change.html" method="post" style="margin: 6px 0px 0px;" data-filters="SubmitOnChange">
  36. <select name="select_list">
  37. <option value="option 1">option 1</option>
  38. <option value="option 2">option 2</option>
  39. <option value="option 3">option 3</option>
  40. </select>
  41. <input type="submit" class="ccs-hidden" name="submit"/>
  42. </form>
  43. <hr/>
  44. <p>This form works exactly as the one above, but the SubmitOnChange data filter is on the select, rather than the form.</p>
  45. <form action="/jframegallery/submit.form.on.change.html" method="post" style="margin: 6px 0px 0px;">
  46. <select name="select_list" data-filters="SubmitOnChange">
  47. <option value="option 1">option 1</option>
  48. <option value="option 2">option 2</option>
  49. <option value="option 3">option 3</option>
  50. </select>
  51. <input type="text" name="textinput" value="If you change me, I don't submit the form.">
  52. <input type="submit" class="ccs-hidden" name="submit"/>
  53. </form>
  54. {% endif %}
  55. </body>
  56. </html>