goog.dom.forms
Namespace.focusAndSelect(el)
Focuses, and optionally selects the content of, a form element.
el
{Element
}
.getFormDataMap(form)
Returns form data as a map of name to value arrays. This doesn't support file inputs.
form
{HTMLFormElement
}
goog.structs.Map
}
.getFormDataString(form)
Returns the form data as an application/x-www-url-encoded string. This doesn't support file inputs.
form
{HTMLFormElement
}
string
}
.getValue(el)
Gets the current value of any element with a type.
el
{Element
}
string
|Array
.<string
>|null
}
.getValueByName(form, name)
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.
form
{HTMLFormElement
}
name
{string
}
Array
.<string
>|string
|null
}
.hasFileInput(form)
Whether the form has a file input.
form
{HTMLFormElement
}
boolean
}
.hasValue(el)
Whether a form element has a value.
el
{Element
}
boolean
}
.hasValueByName(form, name)
Whether a named form field has a value.
form
{HTMLFormElement
}
name
{string
}
boolean
}
.setDisabled(el, disabled)
Enables or disables either all elements in a form or a single form element.
el
{Element
}
disabled
{boolean
}
.setValue(el, opt_value)
Sets the current value of any element with a type.
el
{Element
}
opt_value
{*=}