• Resolved Ana

    (@anaveladev)


    Hello! Is there a way I can create a form that requires the user to enter the email address twice so that we can check that those two fields match before they are able to submit the form? Thanks for any help you can provide.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hello,

    Thanks for reaching out to us.

    This will require additional custom code. You can find an example at https://github.com/ibericode/mailchimp-for-wordpress/blob/master/sample-code-snippets/forms/custom-validation.php.

    You will also need to add another email address field using HTML code to the form and then use the custom code (that can be placed inside the functions.php) file of your active theme to validate and compare data between the main email address field and the 2nd field.

    Thread Starter Ana

    (@anaveladev)

    This is helpful. Thank you! Also, do you have an example of how to set up a custom error message in a case like this?

    Thread Starter Ana

    (@anaveladev)

    Actually, I found a solution for creating a custom error message. One issue I’m seeing is that when I correctly enter an email address twice that was already submitted, I get an error message rather than an alert that I’ve already subscribed. Any suggestions on how I can handle that use case?

    Plugin Contributor Lap

    (@lapzor)

    What error do you see under MC4WP > Other in the log there?

    Maybe you want to switch “update subscriber” on under MC4WP > Form > Settings, so that you don’t get an “already subscribed” notification if that’s the error you meant.

    Thread Starter Ana

    (@anaveladev)

    Thank you! The suggestions above helped! One last question: is it possible to check if the email addresses match before the user clicks the submit button?

    Plugin Contributor Lap

    (@lapzor)

    you would have to write the code to see if the emails match yourself, our plugin doesn’t have that feature build in.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Confirm Email Address Before Submission’ is closed to new replies.