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 based on form field empty or filled in?

  1. Hi. I'm wondering if it's possible to use conditional logic to display a form field base on whether another form field has data in it or not. I only see conditional logic options based on answers on multiple choice or check box kind of answers.

    Or maybe you can help me figure out how to do exactly what I want to do. I have fields for state and country, which are mandatory and are dropdown lists, and a field for city that is and optional text box. I am creating a blog post with the data, and I want to put a comma between city and state, if the city field is filled in. But not if that field is blank. I don't want a comma just hanging out there without a city in front of it.

    Another example is a field for URL. It's also optional. People can enter the URL of their blog. If it's filled in, I want my blog post to to have a label that says "Personal Blog:" before the URL. But I don't want "Personal Blog:" to print if there is no URL filled in.

    For the comma and the text, I was going to use hidden text fields with those characters prepopulated.

    Is there some other way to achieve the desired result?

    beth

    Posted 12 years ago on Wednesday May 4, 2011 | Permalink
  2. Hi Beth,

    Conditional logic is limited to multiple choice, check box, and drop down fields. Unfortunately, I can not think of any way around the straggler comma without using GF hooks to customize the post body content.

    Posted 12 years ago on Wednesday May 4, 2011 | Permalink
  3. Thanks, David. How would I learn about GF hooks and how to use them? I have no idea what that means, but I'd love to figure it out. Is there information on this site?

    Posted 12 years ago on Wednesday May 4, 2011 | Permalink
  4. Here is a link to documentation on all of our hooks:

    http://www.gravityhelp.com/documentation/page/Developer_Docs

    Here is a link to the specific hook that I think you might want to use to accomplish this:

    http://www.gravityhelp.com/documentation/page/Gform_post_data

    Posted 12 years ago on Wednesday May 4, 2011 | Permalink