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 Form

  1. Hi, just did my first form (basic contact) with Gravity and I gotta say, it's a joy compared with cforms. But I also sense there's a lot more under the surface I can do with Gravity but can't really find any samples/examples/tutorials.

    My goal is to recreate the three forms here:
    http://www.divinginstructortraining.com/contact/reservation.asp

    Rather than have the customer hit that page, then choose the program he wants to enroll in, I want to create ONE enrollment form and -- either using icons or a drop-down menu at the top of the form -- change the content dynamically based on which program the customer chooses.

    In other words, the customer hits the Enrollment Form and can choose Program A, Program B or Program C.

    If he/she chooses Program B, the fields for only that program appear.

    Is this possible? I"m not a programmer and cannot write PHP/Javascript, but can follow good examples.

    If not, then I will have to create 3 different forms again (duplicate will be helpful, thanks.)

    SECOND QUESTION.

    Notice my formatting of my form? In particular the colored sections. Can I do that? I saw a forum post about using Section Break. Can the DIVs in those sections be styled with a background color?

    Also, if you notice, I put some questions across two columns. (Example: Choose whether you need equipment or not and IF yes (right column) tell us what gear you need, etc.)

    I think you have some links on doing the two-column format. Can that be done on a per question basis, or does the whole form run 2-columns?

    Sorry, again, very new to this. Any help would be appreciated.

    Posted 13 years ago on Wednesday September 1, 2010 | Permalink
  2. Yes, conditional logic is a feature available on all fields. It can be found in the Advanced tab when editing a field. You turn on conditional logic and then use the available interface to select which condition(s) must be met for that field to show or hide.

    One trick you can use is to use Section Breaks and apply the conditional logic to the Section Break field. When conditional logic is applied to a Section Break it not only hides that field but any fields that appear below that Section Break up to the next Section Break.

    So if you have a drop down where they select a Program you can then create a Section Break for each Program and place the fields for that under each Section Break. Then apply conditional logic to the Section Break to show that section based on the Program selected.

    Forms can be styled using CSS and adding custom CSS to your themes stylesheet to override the default styles. You would have to be proficient with CSS to customize the look of the form. You can use a tool such as FireBug for FireFox to inspect the HTML, see what classes/ids are being used and then write CSS to target and style those elements.

    Two column forms are a more advanced CSS customization. It requires floating elements next to each other. If you aren't very proficient with CSS you may run into issues getting a two column layout to work properly across all browsers.

    Another option is to hire a WordPress consultant who is good at Gravity Forms customizations to assist you with any more advanced customizations you would like to do.

    Posted 13 years ago on Wednesday September 1, 2010 | Permalink
  3. Cool, thanks. The bit about Section Breaks hiding sections is what sounds like is just the trick.

    I kinda downplayed my skills set, as I found if people think I can do stuff, they give me the "stop wasting my time" attitude. I cannot, in fact, write PHP or Javascript (although I did know JS at one point long ago) but I DO understand the concepts at work and can mod code that is already there with handy examples.

    CSS and HTML on the other hand, I'm actually pretty good at. Don't have a lot of experience with floating/relative/absolute positioned elements, but have done them before (with help of Dreamweaver).

    Again, thanks for the help. I think while Gravity seems to lack some of the advanced features of cforms (multi-page forms, etc.) it more than makes up for it with ease of use and customer service!

    BTW -- Is there a reference guide to the form validation? Not that I want to change anything, I just want to understand how the validation works (what it checks for, etc.)

    Your eventual goal to add Regex validation will be nice. I am baffled by most regex, but having the ability to format international phone numbers -- to require that the idiots who message me actually put in their country code -- would be great.

    Lastly, my company is small and my partners who pay the bills cheap tech-neophytes, so I have to get most everything free or dirt cheap. This is the most I've paid for a Wordpress add-on, but it seems to have been worth it :)

    Posted 13 years ago on Wednesday September 1, 2010 | Permalink
  4. Validation is field specific. The only validation available on all fields is the Required field option, which just checks for a value.

    Other than the required field option the only fields that have content validation are some of the advanced fields such as the email field which checks to make sure the email was entered in a valid email format. The numeric field validates the content submitted is in fact numeric, etc.

    Posted 13 years ago on Wednesday September 1, 2010 | Permalink
  5. Mary Hutson
    Member

    I have similar issue to the one posted here. On my page, I have a drop-down to start. Then I will use the Conditional Logic/Section Breaks, as you described within this post, to collect the correct information related to each choice on the starting drop-down.

    My question is this: On Submit, I'd like to be able to redirect the user to a specific page with would contain the correct PayPal button. So, I'd like the page that is displayed to be determined by the choice in the original drop-down list. Is there a way to do that?

    I truly am a newbie--a technical writer by trade dabbling in things way over my head. I would appreciate simple, hand-holding type explanations if you have them. :) I have enjoyed using your product--it's made it possible for me to enter the forms world.

    Posted 13 years ago on Wednesday September 15, 2010 | Permalink