PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Conditional Logic on entire form?

  1. Is it possible to have two forms on a page, and only display one of them dependant on a variable passed through the URL?

    I'm using forms for event booking, and depending on the event category the forms are completely different.

    I know that I could use conditional logic within one form, but as both forms are very different and very large this would be difficulty to deal with.

    Posted 12 years ago on Thursday September 15, 2011 | Permalink
  2. Why not just a php conditional statement in your page template? If the variable passed in the querystring = X, then display form X or if variable = Y, display form Y, etc.

    Posted 12 years ago on Thursday September 15, 2011 | Permalink
  3. Hi Kevin, thanks for the reply.

    Sorry to be stupid but I'm afraid I have very little php experience, is there any way you could give me an example?

    Thanks again.

    Posted 12 years ago on Thursday September 15, 2011 | Permalink
  4. Hi Jon,

    You'd need to set up a page template or something along those lines to implement this snippet, but here is some PHP that would allow you to retrieve any form ID from the query string:

    http://pastie.org/2539332

    A sample URL that would load a form would be like this:

    http://mysite.com/?form_id=1

    This would load form ID 1. You can update the variable to be whatever you'd like.

    Posted 12 years ago on Thursday September 15, 2011 | Permalink