• Resolved Max Sixblade

    (@max-sixblade)


    Hi, first of all thanks for a great plugin, works like charm!
    I was wondering if I can check that validation would be successful without clicking submit button, maybe there is a JS function already which I can execute..
    All I need is
    if everything is ok for current state – > do some JS stuff;
    if not -> scroll to validation error fields.
    Thanks a lot!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Max Sixblade

    (@max-sixblade)

    Just to be more clear on this..
    The perfect solution would be if I could do something like:
    validate(element-that-needs-to-be-validated)

    Plugin Author Daman Jeet

    (@djeet)

    Hi Max,

    Thanks for using this plugin.

    Yes, You can manually trigger validation to each field, get the response in boolean and then do your stuff on that basis.

    Suppose you need to check field id #2 of the form ID #1 of your form, you can do something like:

    
    var response  = all_validations[1][2].validate();
    if(response) { 
        // handle success
       }
     else {
       // handle failure
    }

    Use this code the way you want.
    As you are the first one to request such kind of technical stuff. Please report us if it does not work or you find trouble setting this up.

    Thanks,
    D.Jeet

    Thread Starter Max Sixblade

    (@max-sixblade)

    Thank you so much, it works!
    just one last question, is there a way to check several fields at once, like
    var response = all_validations[1][2, 3, 10].validate();

    Plugin Contributor wisetr

    (@wisetr)

    Hi @max-sixblade,

    No, the only way that snippet can be used is

    var response  = all_validations[1][2].validate();
    if(response) { 
        // handle success
       }
     else {
       // handle failure
    }

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Fire Validation without clicking on Submit button’ is closed to new replies.