Instead of a error message when a duplicate email is submitted. how can I just redirect to a webpage?
Instead of a error message when a duplicate email is submitted. how can I just redirect to a webpage?
Instead of a validation error being returned, do you want to just redirect to a web page, or, when a duplicate email address is entered, should the form submission go through, but after submission land those people on a web page?
Do you have a link to your form online now? When is the email address collected? Is this a single or multi-page form?
form is located at: http://50.116.122.182/~outsidea/
If a duplicate email is submitted, I don't want the form submission to go through, I just want them redirected to a web page.
So, the sidebar form, if someone submits an email address which was previously submitted, just redirect them to a web page? If you can confirm that, we can find a solution for you.
yes, that is correct.
I would check the box "No Duplicates" for the field so that when there is an email address entered which was previously submitted, you can then hijack the duplicate message and return a redirect header instead. You can use the gform_duplicate_message filter: http://www.gravityhelp.com/documentation/page/Gform_duplicate_message
Take a look at this code: http://pastebin.com/p8RfzU4B
That code will apply to form 21, if there are any duplicate field values entered. In your sidebar form, mark only the email field "No Duplicates". If your form ID is not 21, change the 21 on line 04 to your form ID. Change the URL on lines 06 and 07 to the URL you want to direct the visitor to.
No entry will be created because the form submission will not be successful.
I have no duplicates checked for the email field on this form. http://gravity.chrishajer.com/check-your-ticket-number/ You will need to submit the form twice with the same email to see this in action.
(the matching ticket number on the form is a different sort of validation. If you do not want a validation error there, you will need to enter the same string in both ticket fields.)
Let me know if you need more help with that.
I am not clear where to paste the code. Sorry I am not an expert coder.
That code will go in your theme's functions.php. http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F#PHP
If you would like to edit it before you paste it, please do that and share the code here or at pastebin.com and we can check it for you. If you are nervous about editing your theme's functions.php file, please send me a WordPress administrator login for your site and I will help you.
I would really appreciate your help!
I edited the login details out, since this is a public forum.
I tried logging in here: http://50.116.122.182/~outsidea/wp-admin with the details you provided but it did not work. Please send a WordPress administrator login for the site, and the correct URL in case I am trying the wrong site. Thank you.
email chris@rocketgenius.com
I will email info
Did you receive my email with login info?
Don't worry about editing my site. I followed the instructions you provided and it works perfectly! Thanks for your help.
Great. Thank you for the update.