DLSupport.Form

Handle form submissions.

This is used when we cannot use Prototype.

Summary
DLSupport.FormHandle form submissions.
Functions
addParameterAdd the given element into the given parameters object based on some pre-set rules.
disableSubmitFieldsDisable all of the submit fields of the given form.
enableSubmitFieldsEnable all of the submit fields for the given form.
fieldCountRetrieve 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.
submitValueSet the value of the given element as the submit value for the element’s form.
toQueryStringConvert the given form data to a query string.

Functions

addParameter

addParameter: function(parameters,
element,
is_array)

Add the given element into the given parameters object based on some pre-set rules.

Parameters

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.

disableSubmitFields

disableSubmitFields: function(form)

Disable all of the submit fields of the given form.

Parameters

form(object) The form for which all of its submit fields will be disabled.

enableSubmitFields

enableSubmitFields: function(form)

Enable all of the submit fields for the given form.

Parameters

form(object) The form for which all of its submit fields will be enabled.

fieldCount

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.

Parameters

form(object) The form for which the data is to be retrieved from.

Returns

(object) An associative array with the field name as the property and the number of fields with the same name as the value.

submitValue

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.

Parameters

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.

Returns

(boolean) Returns true if successful, false, otherwise.

toQueryString

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.

Parameters

form(object) The form for which the data is to be retrieved from.

Returns

(string) The given form data as a query string.

addParameter: function(parameters,
element,
is_array)
Add the given element into the given parameters object based on some pre-set rules.
disableSubmitFields: function(form)
Disable all of the submit fields of the given form.
enableSubmitFields: function(form)
Enable all of the submit fields for the given form.
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.
submitValue: function(element)
Set the value of the given element as the submit value for the element’s form.
toQueryString: function(form)
Convert the given form data to a query string.