Skip to content

Commit 482c9ef

Browse files
authored
Update readme about setting options before loading
1 parent 90b7453 commit 482c9ef

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The script already contains the `netteForms.js` file, so don't use it again and
1212

1313
Options
1414
-------
15-
You can change default options by calling `LiveForm.setOptions({ ... });` after including the script. Give only options that you want to change. For example:
15+
You can change default options by calling `LiveForm.setOptions({ ... });` **after** including the script. Give only options that you want to change. For example:
1616

1717
```js
1818
<script src="/js/live-form-validation.js"></script>
@@ -24,6 +24,18 @@ You can change default options by calling `LiveForm.setOptions({ ... });` after
2424
</script>
2525
```
2626

27+
Alternatively, if you want to set options **before** the script is loaded, create `LiveFormOptions = { ... };` with options that you want to change. For example:
28+
29+
```js
30+
<script>
31+
LiveFormOptions = {
32+
messageErrorPrefix: 'Error: ',
33+
wait: 500
34+
};
35+
</script>
36+
<script src="/js/live-form-validation.js"></script>
37+
```
38+
2739
### Available options
2840

2941
Option | Description

0 commit comments

Comments
 (0)