From 964c0715685f0d23e4c52c761156ed94fc0f0ffe Mon Sep 17 00:00:00 2001 From: Gorm Casper Date: Sun, 21 Dec 2014 19:07:46 +0100 Subject: [PATCH] Update docs to reflect changes, and to mention the flag (oops) --- README.md | 18 +++++++++++++----- nod.js | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 75e0f97..83b0ac8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Nod v.2.0.1 +# Nod v.2.0.2 Frontend input validation @@ -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. diff --git a/nod.js b/nod.js index a1eb04a..b593a06 100644 --- a/nod.js +++ b/nod.js @@ -2,7 +2,7 @@ /** * * - * nod v.2.0.1 + * nod v.2.0.2 * Gorm Casper * *