Element. Form.js

Contains Element prototypes to deal with Forms and their elements.

License

MIT-style license.

Summary
Element. Form.jsContains Element prototypes to deal with Forms and their elements.
ElementCustom class to allow all of its methods to be used with any DOM element via the dollar function $.
Properties
getValueReturns the value of the Element, if its tag is textarea, select or input.
toQueryStringReads the children inputs of the Element and generates a query string, based on their values.

Element

Custom class to allow all of its methods to be used with any DOM element via the dollar function $.

Summary
Properties
getValueReturns the value of the Element, if its tag is textarea, select or input.
toQueryStringReads the children inputs of the Element and generates a query string, based on their values.

Properties

getValue

Returns the value of the Element, if its tag is textarea, select or input. getValue called on a multiple select will return an array.

toQueryString

Reads the children inputs of the Element and generates a query string, based on their values.  Used internally in Ajax

Example

<form id="myForm" action="submit.php">
<input id="email" value="bob@bob.com">
<input id="zipCode" value="90210">
</form>
 
<script>
 $('myForm').toQueryString()
</script>

Returns

email=b.nosp@m.ob@bob.nosp@m..com&zipCode=90210

returns the element passed in with all the Element prototypes applied.
An Ajax class, For all your asynchronous needs.

Documentation by Aaron Newton & Mootools Developers, generated by NaturalDocs and GeSHi