Transmit dropdown option from one form to another

ltempest 28 Sep, 2015
Hello,
I have two forms, one is a simple dropdown with a submit button, that I show on my homepage. A user selects from this dropdown and clicks submit that takes them to another form with more options for them to complete such as name, email further details etc.

I have replicated the dropdown options from the home module within this form. However what i do not know how to do is transmit the option the user selected on the homepage dropdown to the second form so this field is already preselected with the original dropdown.

I'm sure its possible with perhaps the Session Data option but now sure exactly how to achieve this.

Can anyone offer some advice or direct me to a tutorial on how to do this?

Thanks

Lee
GreyHead 28 Sep, 2015
Hi Lee,

Add a Data to Session action in the On Submit event of the first form with a 'session key' - just a short string to identify the data, say xxx.

Add a Session to Data action in the On Load event of the second form and add the same session key.

Assuming that both drop-downs have the same name - that's it. Test to make sure that it works.

Bob
ltempest 29 Sep, 2015
Ok, I'm must be doing something incredibly stupid! I have both forms setup, with Data to Session and Session to Data actions, but it is still not transferring the selected option. I've checked both form elements have the same name.

What am I missing that is bleedingingly obvious!

Thanks

Lee
GreyHead 29 Sep, 2015
Hi Lee,

Please try moving the Session to Data action in the second form *before* the HTML (Render form) action so that the data is there when the form is rendered.

Bob
ltempest 29 Sep, 2015
Bob,
No luck, I've tried the Session to Data action to before the render but still nothing!

I must being missing something obvious!

Lee
GreyHead 29 Sep, 2015
Hi Lee,

Hmmm . . . the names aren't the same - the name of the drop-down in the second form is 'services'
<select name="services" id="services" size="0" class="form-control A" title="" style="" data-load-state="" data-tooltip="">
<option value="Sell my property">Sell my property</option>
<option value="Building Consultancy">Building Consultancy</option>
<option value="Rural Development">Rural Development</option>
</select>
That could be because you have the Custom option set in the Code tab?? If you use that then the Designer tab settings are ignored.

Bob
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger