Requires

Provides

Form.js

Act as a form to submit data

License:
Public domain (http://unlicense.org).
  1. 21
  2. 22
  3. 23
  4. 24
  5. 25
  6. 26
  7. 27
  8. 28
  9. 29
  10. 30
  11. 31
  12. 32
  13. 33
  14. 34
  15. 35
  16. 36
  17. 37
  18. 38
  19. 39
  20. 40
  21. 41
  22. 42
  23. 43
  24. 44
  25. 45
LSD.Trait.Form = new Class({ options: { pseudos: Array.fast('submittable') }, initialize: function() { this.addEvents({ nodeInserted: function(node) { if (node.pseudos['read-write'] || node.pseudos['form-associated']) node.form = this; } }); this.parent.apply(this, arguments); if (!this.getAttribute('action')) this.setAttribute('action', location.pathname); }, submit: function(event) { this.fireEvent('submit', arguments); if (event && event.type == 'submit') { event.preventDefault(); return this.callChain(); } else return this.send.apply(this, arguments); } });