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.

WP Post category used to populate address field 'state'?

  1. drunkenmugsy
    Member

    Is there a way to use a field on a form to populate another field?

    What I would like to do is have WP category set initially and then use that dropdown to populate the 'state' field in an address field. From what I have read it is not possible without passing it from the URL? It also appears to not be possible with a multipage form?

    I dont believe that... hehe how to do it?

    Posted 13 years ago on Monday October 31, 2011 | Permalink
  2. So your category drop down would be all 50 states, and you would set one category (state) as the default, and you want to make a form field equal to that default category selection? What happens if they change the state/category drop down from the default? How are you setting the default category?

    Posted 13 years ago on Tuesday November 1, 2011 | Permalink
  3. drunkenmugsy
    Member

    Not quite.
    I have a WP category field. The states have been set up as categories. Their is no default set. In a separate address field the address field 'state' is set to hide.

    What I want to do is have the selection in the category field be propagated to the state address, hidden field.

    Posted 13 years ago on Tuesday November 1, 2011 | Permalink
  4. So the user will make his state selection from the drop down, then you want to populate the hidden state field in the form with that information? You could do this with jQuery on the front end, if you needed it to be visible. However, you don't need it visible on the front end: you just want to update another field in your entry with a selection that was made earlier in the form.

    You can use the gform_pre_submission hook to populate one field with the data from another field.
    http://www.gravityhelp.com/documentation/page/Gform_pre_submission

    If you post a link to your form, we can help you with the actual code to make it happen.

    Posted 13 years ago on Tuesday November 1, 2011 | Permalink