Skip to content

Commit

Permalink
Moved input, radio and select tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
serbanghita committed Dec 17, 2023
1 parent e21e548 commit 2ebd50a
Show file tree
Hide file tree
Showing 9 changed files with 404 additions and 323 deletions.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,28 @@ Resulted value:
In case of an error like non-existing form, invalid selector, or no elements `formToObject` will return `undefined` for every valid
cases the method will return an object `{}`.

## Options

`includeEmptyValuedElements` (`boolean`, default `false`)

Return field names as keys with empty value `""` instead of just ignoring them.

`w3cSuccessfulControlsOnly` (`boolean`, default `false`)

TBA

`selectNameWithEmptyBracketsReturnsArray` (`boolean`, default `true`)

`<select>` field names like `name="select[]"` always return an array `[a,b]` instead or array of arrays `[0: [a,b]]`.

`checkBoxNameWithEmptyBracketsReturnsArray` (`boolean`, default `true`)

`<input>` checkboxes with field names like `name=checkbox[]` always return an array `[a,b]` instead or array of arrays `[0: [a,b]]`.

## Browser support

IE 8, Firefox 3.5, Chrome, Safari, Opera 10, every mobile browser.

## Example

![](http://serbanghita.github.io/formToObject.js/formToObj-demo.png)
![](http://serbanghita.github.io/form-to-object/formToObj-demo.png)
170 changes: 0 additions & 170 deletions test/integration/input.test.ts

This file was deleted.

29 changes: 0 additions & 29 deletions test/integration/radio.test.ts

This file was deleted.

78 changes: 0 additions & 78 deletions test/integration/select.test.ts

This file was deleted.

Loading

0 comments on commit 2ebd50a

Please sign in to comment.