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.

Prepopulate the first name & last name field?

  1. Jive Software
    Member

    What is the best way to prepopulate the first name and last name field during the gform_validation hook? It seems like the $field['defaultValue'] does not work for multi field elements?

    Posted 6 years ago on Friday November 16, 2012 | Permalink
  2. David Peralty
    Administrator

    Can you give us more insight into why you are trying to populate a value during validation?

    Posted 6 years ago on Friday November 16, 2012 | Permalink
  3. Jive Software
    Member

    Hi David
    I am coding a stantard software B2B marketing form & bypass logic...

    First time user:

    Prerender Hook:
    Lands on the form and submits all the GF fields defined in the form.

    Validation Hook:
    If email is valid then I make API requests to other system API's to ensure the API response is valid...

    After Submission Hook:
    The data is then validated and then sent to the several different API's to record the user in other systems like Marketing Automation, Then generate a return user unique GUID in a cookie

    ----------------------
    Return user:

    Prerender Hook
    During the prerender hook I look for the return user cookie GUID. If this is the case then depending on the form type I bypass the form.

    - If return user is requesting printed marketing materials I bypass the form entrily and submit the user data stored in wp_rg_lead_detail based on the unique GUID

    - If return user is signing up for event orient marketing posts I hack the gf form field array to only present the email and hidden google tracking inputs.

    Validation Hook
    When the return user resubmits the email for event based forms I then hack the validation to only validate for email. If email is valid, I then make API requests to other system API's to ensure the API response is valid...

    After Submission
    Then during gform_after_submission If return user I grab there information from the wp_rg_lead_detail based on the unique GUID and send the data to the several different API's to record the user in other systems like Marketing Automation.

    My Current Challange:
    For return users In between the validation hook and after submission hook the new entry gets added in the wp_rg_lead_detail so I need to figure out a way to populate the gf form fields array with the correct data during the validation that way when gf inserts the new entry into wp_rg_lead_detail it has all data that is stored for that return user.

    Make sense?

    Posted 6 years ago on Friday November 16, 2012 | Permalink