Viewing 4 replies - 1 through 4 (of 4 total)
  • e

    (@xaviesteve)

    Hi EfremJ,

    Here’s an article with exactly your example:

    WordPress Contact Form 7 Hook Unofficial Developer Documentation and Examples

    See Changing email recipient dynamically depending on code

    Thread Starter EfremJ

    (@efremj)

    Hi, e.

    Thanks for the link. I just spent the last 45 minutes trying to get my form to work but to no avail. ;-}~

    Hi EfremJ,

    I was having a similar issue, but trying to to a conditional redirect using a drop-down menu. I eventually got this to work. The link below takes you to the post I added requesting support. I’ve posted the working code on there.

    https://www.ads-software.com/support/topic/plugin-contact-form-7-conditional-redirect-2?replies=3#post-3201230

    Hope it helps.

    Thread Starter EfremJ

    (@efremj)

    Hi, MarkeyMark.

    Thanks for the tips and post reference. I got the redirect to work–to a certain degree–but what I noticed is that CF7 clears the form values after submit so the value of the radio button I’m using doesn’t even get recorded.

    What happens is that the page winds up on the “else” URL by default since it never sees the other choice. Does that make sense?

    This is what I have in my form element:
    [radio your-payment id:paymenttype default:1 “Pay-in-Full” “3-Payments*”]

    This is what’s in my Additional Settings:
    on_sent_ok: ” if (document.getElementById(‘paymenttype’).value==’3-Payments’) {location.replace(‘/3paycart’)} else { location.replace(‘/pzcart’) } “

    So when I select 3-Payments on my form and submit it, it always winds up on /pzcart instead of /3paycart because the values have already been cleared by CF7.

    Are you getting the same issues?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Contact Form 7] Is Conditional Redirect Possible?’ is closed to new replies.