Skip to content

Commit

Permalink
Update docs to reflect changes, and to mention the flag (oops)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gorm Casper committed Dec 21, 2014
1 parent d25bece commit 964c071
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nod v.2.0.1
# Nod v.2.0.2

Frontend input validation

Expand Down Expand Up @@ -352,16 +352,24 @@ disabled submit button will not do anything to prevent that (see next section).

#### Prevent Submits

If you tell `nod` about the form, then it will prevent submits entirely, until
all added elements are considered valid.
If you tell `nod` about the form and set `preventSubmit: true` in configure,
then it will prevent submits entirely, until all added elements are considered
valid.

If an error is detected (and submition prevented), then we show error messages
for all non-valid elements, and focus on the first of those elements.

```javascript
myNod.configure({
form: '.myForm'
form: '.myForm',
preventSubmit: true
});
```

I should caution the use of this however, as it is hard to get it right in every case (from me, the designer's perspective). So test it well, and make sure it is working correctly in your use case. The last thing you want (I assume) is to prevent your users from submitting your form entirely.
I should caution the use of this however, as it is hard to get it right in
every case (from me, the designer's perspective). So test it well, and make
sure it is working correctly in your use case. The last thing you want (I
assume) is to prevent your users from submitting your form entirely.



Expand Down
2 changes: 1 addition & 1 deletion nod.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
*
*
* nod v.2.0.1
* nod v.2.0.2
* Gorm Casper
*
*
Expand Down

0 comments on commit 964c071

Please sign in to comment.