Ris
Ris

Reputation: 1164

formvalidations.io and conditional validation

I have 10 fields on my bootstrap form, 5 of them needs to be validated when "Save as draft" button is clicked and all 10 of them must be validated when "Submit" button is clicked.

I don't see any example to accomplish the same.

Any examples?

Upvotes: 0

Views: 87

Answers (1)

ratherBeKiting
ratherBeKiting

Reputation: 275

have you tried disabling validation on fields when you click the other button...

function chechUserValidation() {

    $('#create_loan_form')
        .formValidation('enableFieldValidators', 'field1', false)
        .formValidation('enableFieldValidators', 'field2', false)
        .formValidation('enableFieldValidators', 'field3', false)
 .......

Then call the function on click for the second button

Upvotes: 1

Related Questions