Skip Navigation

[Resolved] Pass Information From Button To Form Dynamically

This support ticket is created 3 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by JoshuaJ301 3 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#1637831

Tell us what you are trying to do?
I've set up a page called "Lessons" where I've listed the different type of lessons that are offered. I've created a button "Inquire Today" that links back to the homepage section where the toolset form is located. I was wanting to know if it were possible to pass data from when the user clicks on that button so that it automatically selects that package from the select menu so that the user doesn't have to do it manually?
Is there any documentation that you are following?
N/A
Is there a similar example that we can see?
N/A
What is the link to your site?
beta.iwebnow.net
beta.iwebnow.net/lessons

#1638353

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

The [cred-field] shortcode supports the attribute urlparam using which you can grab the value from the url param.
=> https://toolset.com/documentation/user-guides/front-end-forms/cred-shortcodes/#cred_field

For example - configure your form which displays the "I'm interested in:" dropdown field with urlparam:

 [cred_field field='what-package-are-you-interested-in' force_type='field' class='form-control' output='bootstrap' urlparam='interested_in']

And then the place where you added the " Inquire Today" link: beta.iwebnow.net/lessons
- Pass the correct URL parameter value to your each package with urlparam interested_in=11.

<a href="/?interested_in=11"> Inquire Today </a>
<a href="/?interested_in=12"> Inquire Today </a>
#1638949

Hi Minesh,
That's just brilliant!

One thing I haven't figured out is how to pass that /?interested_in= to an anchor tag?

Currently on my site - the "Inquire Now" buttons link back to the homepage using /#book as url. Is there a way to pass that information so that it goes to the section of the homepage where the form is?

Thanks for all your help.

#1638951

Ah! I figured it out, I need to set the url to be something like this:
/?interested_in=11#book

This will pass the parameter we set and then scroll the page down to the URL anchor for the form section I created.
Absolutely Brilliant!

Thanks for your help Minesh, this helps me out so much.
My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.