Skip to content

Commit

Permalink
Update readme about setting options before loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Robyer authored Sep 28, 2016
1 parent 90b7453 commit 482c9ef
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The script already contains the `netteForms.js` file, so don't use it again and

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

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

Alternatively, if you want to set options **before** the script is loaded, create `LiveFormOptions = { ... };` with options that you want to change. For example:

```js
<script>
LiveFormOptions = {
messageErrorPrefix: 'Error: ',
wait: 500
};
</script>
<script src="/js/live-form-validation.js"></script>
```

### Available options

Option | Description
Expand Down

0 comments on commit 482c9ef

Please sign in to comment.