mgildea / Multi-Step-Form-Js

Multi Step Form with jQuery validation
MIT License
49 stars 25 forks source link

Validation Issue #15

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hello,

I have a problem with validation. It's validating only first rule and ignoring others...

In the example below it's validating only field with name of "first" and ignoring all others.


    $(".msf:first").multiStepForm({
        activeIndex: 0,
        allowClickNavigation: true,
        allowUnvalidatedStep: false,
        hideBackButton: false,
        validate: {
            rules: {
                first: {
                    required: true,
                    digits: true
                },
                second: {
                    required: true,
                    digits: true,
                    maxlength: 5
                },
                third: "required"
            }
        }

    });

Is it just me or there is a problem with the plugin?

Regards

mgildea commented 6 years ago

I don't think its the plugin, I just pass the validation rules along to jquery validation. Are these hidden inputs fields?

ghost commented 6 years ago

No, normal input fields. I will keep playing around to find out what's causing the issue.

Regards

mgildea commented 6 years ago

do you have the same problem if you define the validation rules via data attributes instead of the json object?

ghost commented 6 years ago

Validation using data attributes works fine.