The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group
Conditional logic to determine whether to Log in or Register
I built two forms, "Simple User Registration" and "Full User Registration". I also have a page for each with Registration on left side and Login on right side.
One page has a survey and I want it to take three possible routes on 'Submit' depending on the following:
- If user not logged in and answers "No" to question #4, then direct to Simple User Registration/Login page
- If user not logged in and answers "Yes" to question #4, then direct to Full User Registration/Login page
- If user is logged in, then direct them to 'Resources' page
How can I accomplish this?
Thanks
May 12, 2017 at 9:23 pm
This should get you at least partly there: In the Form Actions, set On Submit to Redirect to URL and in the URL field, use the regular Formidable [IF 123] conditional to do something like this - (REMOVE THE BACKTICKS ` AT THE BEGINNING AND THE END OF THIS URL, I HAD TO INCLUDE THEM TO GET THIS MESSAGE TO POST CORRECTLY)
`https://yourdomain.com/[if 123 show=value equals="1"]simple-user-registration-page/[/if 123][if 123 show=value equals="2"]full-user-registration-page/[/if 123]`
where 123 is the field id for your question 4. You need to select Separate Values for that field for this to work and enter in the values of 1 for no and 2 for yes per above.
I'd have to think further about how to handle the logged in/not logged in piece but I'm sure there's a way to do it.
July 3, 2017 at 7:03 am
Thank you for your response. I'm just getting around to this and I may have simplified it too much that I'm not sure how to adapt it to the multiple choice.
The question is 7 choices of which the last one is "Do not use any of these products". Multiple choices can be checked. So, if any or all choices 1 through 6 are checked, then full registration. Only "Do not use..." leads you to simple registration.
Another question, right now all choices could be checked, including "Do not use...". But you can't be both a user and a non-user. How do I manage that? Is there a condition available where if you check "Do not use..." then all other selections become unchecked?
Thanks
July 4, 2017 at 11:53 am
The only way that I know of to have the form not allow someone to simultaneously click the last item if they already chose one of options 1 to 6 is through javascript. What I would do instead is rephrase the question to something like "Which of these products do you currently use?" and only include items 1 to 6. Or, you could do it through two fields:
Do you already use any of our products?
Radio Button: yes no
If yes, conditionally display the checkbox field with choices of 1 to 6
Then in your Form Actions On Submit, you could do something like this
`https://yourdomain.com/[if 25 show=value equals="yes"]simple-user-registration-page/[/if 25][if 25 show=value equals="no"]full-user-registration-page/[/if 25]`
Where 25 is the radio button field
If you want to stick with the original design of 7 options on the checkbox, this would at least get the redirect to the proper page (Simple or Full)
`https://yourdomain.com/[if 123 show=value less_than="7"]simple-user-registration-page/[/if 123][if 123 show=value equals="7"]full-user-registration-page/[/if 123]`
This requires that Separate Values be used on the checkbox setup options, with the corresponding product options assigned a value from 1 to 6, and the "do not use" option given the value of 7. You'd also need to implement some javascript on the form to see if the last option was checked, and not allow the prior 6 to also be checked, and vice versa.
As before, if you use any of those snippets, you need to remove the backticks characters. Those are included only so that this forum will display the URLs correctly.
Discussion closed.