Skip to content

Latest commit

 

History

History
22 lines (12 loc) · 667 Bytes

README.md

File metadata and controls

22 lines (12 loc) · 667 Bytes

Switch - formUtils

Convenience methods for form datas


.toJSON( HTMLFormElement, Boolean )

Return a JSON object containing the name and values of each field element of the form. If the form contains fields with the same name, the values of those fields will be in an array.

Parameters

  • HTMLFormElement - the form element you want the data from
  • Boolean - Whether or not limit the object to string values. Filter out file inputs. Defaults to false.

.toQuery( HTMLFormElement )

Retrun a query string without the leading ?.

.hasFile( HTMLForElement )

Return true if the form has at least one file input that is not empty.