• Resolved wpdevcity

    (@wpdevcity)


    How can I add a confirm email text field, so that when you click “Submit” on the form. It checks both email fields to make sure they match.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Lap

    (@lapzor)

    While it’s definitely possible to do this, it’s not a feature of our plugin and custom code like this is out of scope for our free support.

    If you have jquery in your theme it should look something like this:

    <script>
    $(‘#mc4wp-form1’).submit(function() {
    var email1 = $(#email).text();
    var email2 = $(#email2).text();
    if (email1 != email2) {
    alert(‘Error, fill the same email!’);
    return false;
    }
    else
    {
    return true;
    }
    });
    </script>

    This is assuming your form has ID “mc4wp-form1″, your email has id=”email” and the second email field has id=”email2″

    This code wouldn’t work “out of the box” but it will get you on your way I hope.
    If you have a license for Premium support you can contact us there if you need further help.

    Hope that helps!

    Kind regards,

    Thread Starter wpdevcity

    (@wpdevcity)

    I will pop you over an email shortly from the address I purchased with.

    Plugin Contributor Lap

    (@lapzor)

    <script language=’javascript’ type=’text/javascript’>
    document.getElementById(’email2′).setCustomValidity(“Must match email field”);
    function checkemail() {
    if (document.getElementById(’email2′).value == document.getElementById(’email’).value) {
    document.getElementById(’email2′).setCustomValidity(“”);
    } else {document.getElementById(’email2′).setCustomValidity(“Must match email field”);} }
    </script>

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Confirm Email Field’ is closed to new replies.