Conditional redirect based on radio button options
-
I have a few clients where we have a simple customer feedback form. The idea is that they give us their email and select a rating from 1 to 5 stars.
If they select 1 to 3 stars we redirect them to a second form where they can give us some direct feedback.
If they select 4 to 5 stars, we know they love the clients service so we redirect them directly to a third-party review site (Google+, TrustPilot or Feefo).
This works really well.
We have been using the on_sent_ok() hook with this code:
on_sent_ok: "var Iso = $("input[name=rating]:checked").val() ; if(Iso == '1 = Poor' ){ location = '/feedback'; } if(Iso == '2 = Not great' ){ location = '/feedback'; } if(Iso == '3 = OK' ){ location = '/feedback'; } if(Iso == '4 = Great' ){ location = '/share-your-experience/'; } if(Iso == '5 = Excellent' ){ location = '/share-your-experience/'; }"
Now that this method is not preferred, we should be using DOM event redirect. What should we be putting within the redirect script?
Thanks so much!
- The topic ‘Conditional redirect based on radio button options’ is closed to new replies.