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.

Compound custom field not being saved

  1. Hi There!

    I'm running into an issue with a compound custom field I have created. Two actually, but I suspect they've got the same cause. I've created a custom 'Full Name' field consisting of a Title dropdown, and text fields for first, middle and last.

    The first issue is that my custom field is not being saved. The second is that the dropdowns on the User Registration Settings page only show me the Field Label, ie 'Full Name'. I don't see 'Full Name (Title)', 'Full Name (First)', etc for the individual components of the field.

    What am I missing?

    Posted 11 years ago on Tuesday April 2, 2013 | Permalink
  2. How did you create this compound custom field? Can you share the code you're using to do that?

    Posted 11 years ago on Tuesday April 2, 2013 | Permalink
  3. Hi Chris,

    Here's the relevant code: http://pastie.org/7279539
    The form is at http://beta.ncohr-rcrsb.ca/join-the-network

    I've been digging a bit deeper... Comparing dumps of $field for my full_name field and the built-in address field, I can see that I should have something in $field['inputs'].

    I tried adding the following at line 37, but it didn't make any difference:

    $field['inputs'] = array(
    				array('id' => '9.1', 'label' => 'Title', 'name' => ''),
    				array('id' => '9.2', 'label' => 'First', 'name' => ''),
    				array('id' => '9.3', 'label' => 'Initial', 'name' => ''),
    				array('id' => '9.4', 'label' => 'Last', 'name' => '')
    		);

    How would I go about properly adding the inputs details to the field array?

    Thanks!

    Posted 11 years ago on Tuesday April 2, 2013 | Permalink
  4. I'll ask the development team this question for you.

    Posted 11 years ago on Tuesday April 2, 2013 | Permalink
  5. I heard back from one of the developers. Take a look at the gform_editor_js_set_default_values hook: http://www.gravityhelp.com/documentation/page/Gform_editor_js_set_default_values .
    This is used to create the inputs collection. You can do something like this: http://pastie.org/7317622

    Posted 11 years ago on Friday April 5, 2013 | Permalink
  6. That did the trick! Thanks for the help!

    -m

    Posted 11 years ago on Friday April 5, 2013 | Permalink
  7. Thanks for the update.

    Posted 11 years ago on Saturday April 6, 2013 | Permalink

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