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.

Dynamically 'Tick' a Checkbox

  1. websiteessentials
    Member

    I have created a 'Get a Quote' Form and have used gform_pre_render to dynamically populate my checkbox list from my 'Props' category.

    What I need to do now, for each post in the Props category, is to have a button that says Add to Quote. When a customer clicks on this button the checkbox in the Quote form will automatically be ticked.

    Are you able to do dynamically select values with checkboxes? If not is there another way I may be able to achieve what I'm after? Maybe an Add On? Any help is greatly appreciated.

    Posted 12 years ago on Tuesday May 15, 2012 | Permalink
  2. David Peralty

    You are able to dynamically select checkbox values. You will want to turn dynamically populate and set a variable name. You'll also want to turn values on in your checkbox field. Then you can pass what you want checked through the URL when the button is clicked.

    Posted 12 years ago on Tuesday May 15, 2012 | Permalink
  3. websiteessentials
    Member

    Thanks for that David, I had done all that but I didn't have permalinks turned on, once I turned it on it worked. Now however, when I click on the button I am taken to the form which has that prop item selected but if I go back to my Props list click on another button to add another Prop to the Quote the original tick is missing? Is there a way to keep the prop items selected even after moving from the page the form is on?

    Posted 12 years ago on Wednesday May 16, 2012 | Permalink
  4. David Peralty

    This would require customization to have work. When you leave the page and come back, the form doesn't remember what you previously put into it because that's not how forms work by default. You would have to save form data to a cookie or session to have it reload when you come back, but it wouldn't easily allow additive data like this (new props being added onto a form that already has props). Is there no reason your props request form and your second form aren't the same form?

    Posted 12 years ago on Wednesday May 16, 2012 | Permalink
  5. worked for me after an upgrade from 1.5.8 to 1.6.12

    awesome thanks!!

    Posted 11 years ago on Tuesday February 12, 2013 | Permalink

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