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.

Real-Time Pre-Filled Select Boxes

  1. rcalise
    Member

    I want to offer a pre-filled list of upcoming events for my users to sign up for.

    There's an incoming feed of these events, is there any way to have Gravity Forms automatically update the values of a select box on-the-fly without any user intervention?

    I've tried using the hooks mentioned in other posts, and that I've been able to glean from trying to reverse engineer the add-ons, but I haven't been able to make this work. Can anyone help?

    Thanks,
    Robert

    Posted 14 years ago on Tuesday November 30, 2010 | Permalink
  2. You would have to use PHP and hooks to populate the fields you want to populate. The PHP will vary depending on what you are trying to do and where the data is coming from. I can't tell you what that PHP would be because it has too many variables (hardcoded? from a database? from an RSS feed? etc.).

    All I can tell you is what hook you would use to pre-populate a dropdown field in Gravity Forms using PHP and give you an example of how to implement it.

    Here is a PDF file that contains documentation for the gform_pre_render hook. This documentation will be available soon on the site when we launch the revised site for Gravity Forms v1.5. For now you can via the documentation for this hook via the PDF file below.

    GFORM_PRE_RENDER HOOK DOCUMENTATION:

    http://s3.amazonaws.com/gravityforms/documentation/gform_pre_render.pdf

    Posted 14 years ago on Tuesday November 30, 2010 | Permalink
  3. rcalise
    Member

    Carl,

    The only issue I have with pre_render is that it's form-specific. Is there a way to accomplish this globally based on field name?

    For example:
    1. Any field labeled Contact0LeadCategory would pull in our CSV from it's URL, populate values accordingly.
    2. Another field, Contact0LeadSource has categories for each type of lead source, so when one is selected in the Contact0LeadCategory field, Contact0LeadSource is filtered.

    Posted 14 years ago on Tuesday November 30, 2010 | Permalink
  4. Do you have an example of an Infusionsoft form somewhere that I could look at to see what you are trying to accomplish within Gravity Forms because there may be a better way to go about doing this. Something along the lines of what we do with MailChimp and Campaign Monitor may be more appropriate.

    Posted 14 years ago on Tuesday November 30, 2010 | Permalink
  5. rcalise
    Member

    Carl, I've been through both the MailChimp and CampaignMonitor code and as far as I've been able to tell, they only accomplish part of what I'm looking to do - the form submission end of it, using Infusionsoft's API to send the data.

    Maybe a better example than lead source would be Event Registration drop-downs.

    The first drop-down would contain a list of cities where we have events.

    If Austin, TX is selected, a new dropdown should appear.

    [ Austin, TX ]
    [ December 2, 2010 @ 9:00 am ]
    [ December 5, 2010 @ 10:00 am ]

    Likewise for, say, Boston, MA.

    [ Boston, MA ]
    [ December 4, 2010 @ 2:00 pm ]

    (etc)

    Since these dates will constantly change as time passes and new cities/events are added into our system, manually updating them in Gravity is just not an idea situation, so the idea is to bring them in using a URL like this:

    http://domain.com/events/public/events.php?city=AUS

    Which would return Comma Separated Values that could then be parsed and populated into the appropriate drop-down boxes.

    1,0,2010-12-04,14:00 // City Id, Event Id, Event Date, Event Time

    This way, I could create (in Gravity) one drop-down box of the available cities, and then corresponding pre-populated drop-downs for each city that display conditionally.

    Does that make sense?

    Posted 14 years ago on Tuesday November 30, 2010 | Permalink

This topic has been resolved and has been closed to new replies.