Handle form submissions.
This is used when we cannot use Prototype.
| DLSupport.Form | Handle form submissions. |
| Functions | |
| addParameter | Add the given element into the given parameters object based on some pre-set rules. |
| disableSubmitFields | Disable all of the submit fields of the given form. |
| enableSubmitFields | Enable all of the submit fields for the given form. |
| fieldCount | Retrieve an object with its property names being all the named fields of the given form and its value being how many fields have that name. |
| submitValue | Set the value of the given element as the submit value for the element’s form. |
| toQueryString | Convert the given form data to a query string. |
addParameter: function( parameters, element, is_array )
Add the given element into the given parameters object based on some pre-set rules.
| parameters | (object) The parameter object. |
| element | (object) The element to try to add to the parameters object. |
| is_array | (boolean) Whether or not the value should be considered as an array. |
fieldCount: function( form )
Retrieve an object with its property names being all the named fields of the given form and its value being how many fields have that name.
| form | (object) The form for which the data is to be retrieved from. |
(object) An associative array with the field name as the property and the number of fields with the same name as the value.
submitValue: function( element )
Set the value of the given element as the submit value for the element’s form. This is useful for forms to be sent via AJAX that has multiple submit buttons.
| element | (object) The element that contains the submit value. Note that the element must be a DOM element with the property “form” which points to the form for which the element belongs to. |
(boolean) Returns true if successful, false, otherwise.
toQueryString: function( form )
Convert the given form data to a query string. Although this will handle fields that can have multiple values like checkboxes, make sure you name it appropriately however.
| form | (object) The form for which the data is to be retrieved from. |
(string) The given form data as a query string.
Add the given element into the given parameters object based on some pre-set rules.
addParameter: function( parameters, element, is_array )
Disable all of the submit fields of the given form.
disableSubmitFields: function( form )
Enable all of the submit fields for the given form.
enableSubmitFields: function( form )
Retrieve an object with its property names being all the named fields of the given form and its value being how many fields have that name.
fieldCount: function( form )
Set the value of the given element as the submit value for the element’s form.
submitValue: function( element )
Convert the given form data to a query string.
toQueryString: function( form )