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.

Custom Filter to display a custom form field

  1. Chris
    Member

    I am going to try my best to explain what I am doing.

    I want to create a two page form.

    One page one, I am going to have a field for the user to fill out.
    One page two I want to dynamically display different options for a field based on the value on page one. I can't use the conditional logic built in based on the type of field that is on page one.

    Is there a way I can use a custom filter (in functions.php) asking... If value of "input_17_1" = "myvalue" then field on page two (input_17_2) is theseoptions, else theseoptions2.

    If input_17_1 = myvalue

    input_17_2 = theseoptions
    else
    input_17_2 = theseoptions2

    Hope that makes sense. I have successfully changed confirmation emails based on a selected value but am trying to change field options on a second page based on a value on the first page.

    Posted 12 years ago on Monday August 13, 2012 | Permalink
  2. David Peralty

    Here is a hook for grabbing the page change:
    http://www.gravityhelp.com/documentation/page/Gform_post_paging

    That might help you with things. You could copy the value to a hidden field on page two and use conditional logic then to give you what you want.

    Posted 12 years ago on Monday August 13, 2012 | Permalink
  3. Chris
    Member

    Thanks! Do you know of a page that has an example of the above being used? I'm not the best with coding but can follow examples and kinda hack it together from there :)

    Thanks

    Posted 12 years ago on Monday August 13, 2012 | Permalink
  4. David Peralty

    Sorry, I don't have any examples beyond the documentation. Look through the gform_pre_render documentation as it might help you better understand what you need to do.

    Posted 12 years ago on Monday August 13, 2012 | Permalink
  5. Chris
    Member

    Thanks, I'll see if I can find someone that is more knowledgable about the code and have them help me through this. Appreciate you pointing out the above info

    Posted 12 years ago on Monday August 13, 2012 | Permalink