• Resolved Marcin

    (@marcinkopec)


    Hi,
    i wrote additional script to compare entered values into e-mail and Repeat e-mail field. After pressing Submit button I execute this

    $(".button-submit").click(function(){
    var fistInput = document.getElementById("wdform_19_element12").value;
    var secondInput = document.getElementById("wdform_20_element12").value;
    
    if(fistInput != secondInput)
    {
    $("#wdform_19_element12").css("background-color","#E6635B");
    $( "#wdform_19_element12" ).effect( "shake" );
    $("#wdform_20_element12").css("background-color","#E6635B");
    $( "#wdform_20_element12" ).effect( "shake" );
    return false;
    }
    });

    Script works, however, a form is executed anyway. I was looking the part of code what is executed after pressing Submit button but I couldn’t find.
    How can I stop Submission on this conditions?
    Regards,
    Marcin

    https://www.ads-software.com/plugins/form-maker/

Viewing 1 replies (of 1 total)
  • Sona

    (@support-web-dorado)

    Dear Marcin,

    If you want to use the script to validate inputs, please add the code to FMViewForm_maker.php file. Search for check_required<?php echo $form_id ?> function and find the following code:
    if (window.before_submit) {
    before_submit();
    }

Viewing 1 replies (of 1 total)
  • The topic ‘Submit on condition’ is closed to new replies.