Skip to content

Commit 9ca281c

Browse files
Update the form functions documentation
Update the .gitignore file too
1 parent 7a74ef0 commit 9ca281c

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.cache
2+
*.mm

docs/Documentation/instantiated methods.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,18 @@ funcCallback([result1, result2, result3], anElement);
195195
## Form functions
196196

197197
AutoNumeric elements provide special functions to manipulate the [form](https://developer.mozilla.org/en-US/docs/Learn/Forms) they are a part of.
198-
Those special functions really work on the parent `<form>` element, instead of the `<input>` element itself.
198+
Those special functions really work on the parent `<form>` element, instead of the `<input>` element itself.
199199

200-
The functions below makes retrieving and sending form values back to the server easily, be it formatted on not.
200+
Form functions can be divided in two categories:
201+
202+
- Functions that manipulate the form values, and
203+
- Functions that submit the form values to the server.
204+
205+
### Access and manipulate the form values
206+
207+
The functions below makes retrieving and preparing the form values easy. Those values can be formatted or not, and in any format you would want (`Array`, JSON, string, etc.).
208+
209+
You can then decide how and when to send those form values to the server.
201210

202211
| Method | Description | Call example |
203212
| :---------------- | :----------- | :----------- |
@@ -219,6 +228,11 @@ The functions below makes retrieving and sending form values back to the server
219228
| `formUnformatLocalized` | Unformat all the AutoNumeric-managed elements that are a child to the parent <form> element of this `anElement` input, to localized strings | `anElement.formUnformatLocalized();` |
220229
| `formReformat` | Reformat all the AutoNumeric-managed elements that are a child to the parent <form> element of this `anElement` input | `anElement.formReformat();` |
221230

231+
### Submit the form values
232+
233+
Submitting the form values to the server can be done with a single AutoNumeric function call.
234+
Moreover, the functions below may take a [callback](https://developer.mozilla.org/en-US/docs/Glossary/Callback_function), giving you more control on what to do when submitting data to the server.
235+
222236
The following functions can either take a callback, or not. If they don't, the default `form.submit()` function will be called.
223237

224238
| Method | Description | Call example |

0 commit comments

Comments
 (0)