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.

Populate input dynamically - place selected checkboxes into an input

  1. I have a gravity form on my site that looks like this:

    Activities:
    [checkbox] Brand
    [checkbox] Retailer
    [checkbox] Other

    Tags:
    [Text input]

    I want to dynamically fill the text input with the selected activities, so for example when Brand is selected it places Brand into the text input.

    Is this possible with dynamic population? If so is there any tutorials for me to follow?

    Cheers!

    Nick

    Posted 9 years ago on Tuesday October 30, 2012 | Permalink
  2. This is not possible with dynamic population, because the form has not been submitted: the only change to the page is that the box was checked. You will have to use jQuery to populate the tags with the selections from your checkboxes.

    If you don't need to display the checkbox values in the tag area on the same page, but just need to add those tags, we can do that after the form is submitted by updating the tags. The user would not see it, but your post would be tagged with those checkbox values.

    Posted 9 years ago on Wednesday October 31, 2012 | Permalink
  3. The tags are currently a hidden field so doing it as per your second method could potentially work, how would I go about doing this? Cheers

    Posted 9 years ago on Wednesday October 31, 2012 | Permalink
  4. I did something similar to add the first and last name from a form submission as tags on a post (after the form was submitted). See this reply: http://www.gravityhelp.com/forums/topic/post-tags-auto-populatecontent-template#post-70496

    You will have to modify the code for your application, but the process would be the same.

    If you need to have the checkbox values stored as tags in the hidden field in the entry, you would probably have to use the gform_pre_submission_filter to save the values from one field into another field in the same form.

    Posted 9 years ago on Wednesday October 31, 2012 | Permalink