Solved

Pre-populating forms depending on previous action

  • 31 May 2021
  • 9 replies
  • 122 views

Hello folks,

I have a "select" button for each category, and there are several categories.

Selecting this select button should bring up a popup form and preselect a value depending on which category was chosen. (They share the same popup form)

How do you let the popup form know which select was chosen?

icon

Best answer by James Shin 4 June 2021, 16:22

View original

9 replies

Userlevel 6
Badge +3

Hi @Mooo0 have you used the https://developers.elementor.com/dynamic-tags/ ? 

Userlevel 4
Badge +5

Hi @James Shin James,

I’m not a 100% sure what it is you’re asking. Can you elaborate on what it is you’re expecting to happen, also further in your form?

Hello,

Thanks for your replies.

 

What I have on the webpage is listing of 3 plans: Plan A, Plan B and Plan C.

 

Each of those plans have a button called "Select". When users click on select, it brings out a popup form where they can fill in their information and submit.

One of the field in the form is a select type field, which contains a list of plans I've mentioned above.

What I want to achieve is: when users click on a select button for a plan, it will also automatically choose the same plan in the popup form, preventing users having to choose again.

 

Hello @Mario Barretta ,

 

I had a look at dynamic tags and I’m not sure if it will help me for my situation.

It is used for dynamic values that are set per page/blog etc but I’m not sure how it could be used for passing values of the element/objects clicked?

Userlevel 6
Badge +3

Hello @Mario Barretta ,

 

I had a look at dynamic tags and I’m not sure if it will help me for my situation.

It is used for dynamic values that are set per page/blog etc but I’m not sure how it could be used for passing values of the element/objects clicked?

Tag are various → https://elementor.com/help/dynamic-tags-pro/ and i remember (hope to not wrong) to have done something looklike thta you request (for this reason i’ve suggested to investigate in this argument)
Give a look also to Twig+Timber project https://upstatement.com/timber/ and how to manage and edit twig on elementor sites

Hello @Mario Barretta ,

I still do not understand how Dynamic Tags (pro) can be used for my situation.

My understanding is that Dynamic tag values are set on the page/blog settings, which are done prior to rendering the website.

The value that I wish to pass are done live via UI (If I select Plan A , it will send “plana”, if I select Plan B, “planb” etc).

I am not certain how this can be achieved using Dynamic Tags. Are you able to elaborate further please?

Userlevel 6
Badge +3

Hello @Mario Barretta ,

I still do not understand how Dynamic Tags (pro) can be used for my situation.

My understanding is that Dynamic tag values are set on the page/blog settings, which are done prior to rendering the website.

The value that I wish to pass are done live via UI (If I select Plan A , it will send “plana”, if I select Plan B, “planb” etc).

I am not certain how this can be achieved using Dynamic Tags. Are you able to elaborate further please?

Hi @James Shin i’ve directly tried and with the native Elementor’s function is not possible.

It’s necessary to work with additional custom javascriptor to use third party plugin.

Sorry for my misunderstanding, in my mind i’ve related that i did in the past with Dynamic Tag pro but was not correct.

That’s totally fine @Mario Barretta . Thanks anyway.

I’ve played with it for a while and I think I’ve managed to have it working.

What I did was to create a global JavaScript variable, which stores the value of the button that was selected. This can be achieved by using the <HTML> component in Elementor and fetches the value from the button via on click.

On the popup, insert another <HTML> component, which will look up on this global variable and choose the right item from the select list.

 

Hope this helps others!

Userlevel 6
Badge +3

That’s totally fine @Mario Barretta . Thanks anyway.

I’ve played with it for a while and I think I’ve managed to have it working.

What I did was to create a global JavaScript variable, which stores the value of the button that was selected. This can be achieved by using the <HTML> component in Elementor and fetches the value from the button via on click.

On the popup, insert another <HTML> component, which will look up on this global variable and choose the right item from the select list.

 

Hope this helps others!

Thank You

Reply