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.

Adding new custom field type

  1. I've been playing with the hooks all night, but I still can't find a way to create a custom field the way I want.

    Technical question:
    I'm using gform_add_field_buttons to add a new button, which has onclick = "StartAddField('vehicleyear')". When I click on the new button, it adds the field but I can't edit it. Is there a way to create a pre-propulated select field?

    Background:
    I'm setting up a insurance quote form for my client, and they want the vehicle year and model to be pulled form somewhere else. I also want to make it extremely easy for them to customize the form.

    My plan was to create a new button group called "Insurance Fields" and add the two buttons there for year and model. When they click on the button, it'd create a select type with everything pre-populated so they don't have to touch anything else.

    So far I've got the new button groups setup but I'm having problems creating the fields.

    Do you have an example/demo that explain how to use the hooks to get the result that I'm looking for?

    Thanks!

    Posted 13 years ago on Thursday June 9, 2011 | Permalink
  2. Here's the code for what I'm trying to do... https://gist.github.com/1016695

    Posted 13 years ago on Thursday June 9, 2011 | Permalink
  3. You are pretty close. The next step is to add the code to create the pre-populated drop down inside the ih_gform_field_input() function. That function should return the string containing the <select> input populated with all years you want to be displayed.

    Posted 13 years ago on Friday June 10, 2011 | Permalink