Home

# Library goog.dom.forms

Function Summary
| `addFormDataToMap_(?goog.structs.Map map, string name, string value)` Adds the name/value pair to the map.
| `addFormDataToStringBuffer_(?Array sb, string name, string value)` Adds a name/value pair to an string buffer array in the form 'name=value'.
| `focusAndSelect(?Element el)` Focuses, and optionally selects the content of, a form element.
| `getFormDataHelper_(?HTMLFormElement form, ?Object result, ?Function fnAppend)` Returns the form data as a map or an application/x-www-url-encoded string. This doesn't support file inputs.
| `getFormDataMap(?HTMLFormElement form) ⇒ !goog.structs.Map` Returns form data as a map of name to value arrays. This doesn't support file inputs.
| `getFormDataString(?HTMLFormElement form) ⇒ string` Returns the form data as an application/x-www-url-encoded string. This doesn't support file inputs.
| `getInputChecked_(?Element el) ⇒ ?string` Gets the current value of a checkable input element.
| `getSelectMultiple_(?Element el) ⇒ ?Array.<string>` Gets the current value of a select-multiple element.
| `getSelectSingle_(?Element el) ⇒ ?string` Gets the current value of a select-one element.
| `getValue(?Element el) ⇒ (Array.<string>|null|string)` Gets the current value of any element with a type.
| `getValueByName(?HTMLFormElement form, string name) ⇒ (Array.<string>|null|string)` Returns the value of the named form field. In the case of radio buttons, returns the value of the checked button with the given name.
| `hasFileInput(?HTMLFormElement form) ⇒ boolean` Whether the form has a file input.
| `hasValue(?Element el) ⇒ boolean` Whether a form element has a value.
| `hasValueByName(?HTMLFormElement form, string name) ⇒ boolean` Whether a named form field has a value.
| `setDisabled(?Element el, boolean disabled)` Enables or disables either all elements in a form or a single form element.
| `setInputChecked_(?Element el, (boolean|string=) opt_value)` Sets a checkable input element's checked property. #TODO(user): This seems potentially unintuitive since it doesn't set the value property but my hunch is that the primary use case is to check a checkbox, not to reset its value property.
| `setSelectMultiple_(?Element el, (Array.<string>|null|string=) opt_value)` Sets the value of a select-multiple element.
| `setSelectSingle_(?Element el, string= opt_value)` Sets the value of a select-one element.
| `setValue(?Element el, <Any Type> opt_value)` Sets the current value of any element with a type.