jbonfardeci / ShockoutForms

SharePoint + Knockout MVVM forms - an InfoPath killer
32 stars 8 forks source link

Validation doesn't work on Submit #17

Closed leolorenzoluis closed 8 years ago

leolorenzoluis commented 8 years ago

Using

<so-checkbox-group params="val: Changes"></so-checkbox-group>

It doesn't validate the check boxes.

jbonfardeci commented 8 years ago

Why do you think that is? It's explained in the doc and is intentional. On May 13, 2016 11:07 AM, "leolorenzoluis" notifications@github.com wrote:

Validation only works when you click Submit, but on Save it creates the item and bypasses validation.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/jbonfardeci/ShockoutForms/issues/17

leolorenzoluis commented 8 years ago

The documentation says on save. I understand Save won't balidate but Submit should?

leolorenzoluis commented 8 years ago

'if (isSubmit && !self.formIsValid(vm)) { return; }'

It does validate on other fields but not this so template? Could you show me which documentation you're referring to?

jbonfardeci commented 8 years ago

Validation occurs on Submit but not Save. This allows users to fill out long forms and save their work in progress. In our organization, sometimes an exec will have a form open the whole day as they deal with interruptions constantly.

If using this workflow, you must add a step in your SharePoint workflow that waits until IsSubmitted (boolean Yes/No) is equal to true; then the remaining workflow steps occur.

For Knockout components, you must set the option required: true. For other non-knockout components, add there required attribute to the element.

On May 15, 2016, at 5:36 PM, leolorenzoluis notifications@github.com wrote:

The documentation says on save. I understand Save won't balidate but Submit should?

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/jbonfardeci/ShockoutForms/issues/17#issuecomment-219315201

leolorenzoluis commented 8 years ago

Right, I guess GitHub didn't update my Title. I originally had it as Validation not occuring on Save, but I changed it to Validation not occuring on Submit. When I click submit, it validates on other fields like so-text-field but not so-checkbox-group even adding required attribute.