Forums

Passing variables from form module to formpage

h4nneke 03 Jul, 2011
Hello,

I have a small form which is displayed in a module. Then a have a larger form which is displayed within a normal page. When the form in the module is submitted, it redirects to the other form in the page.
passing variables between the forms goes automatically when both input fields are named the same. So, the value in the name field of the module is shown in the name field of the form on the normal page after submission.
That's great, but I only want to pass the variable when it meets some requirements.
How can I do that?
GreyHead 03 Jul, 2011
Hi h4nneke,

What kind of test do you want to do?

You could run them in an OnSubmit box in the module form and then use the ReDirect plug-in to do the redirection; or you could pass the variable anyhow and run the tests in the Form HTML of the second form.

Bob
h4nneke 03 Jul, 2011
Thanks for your reply

first: my input fields have default values like 'name:', I don't want to pass that to my second form. I think I just figured out how to do that. I did put the tests in the onSubmit box, but I didn't set 'email the results' to 'yes'. So that part is solved

second: In the first form I have a dropdown box where visitors can choose to donate by direct debit (that's the second chronoform) or iDeal (redirect to a form outside joomla)

I managed to redirect the form based on the visitors input by creating a custom redirect like in this post: http://chronoengine.com/forums.html?cont=posts&f=2&t=16814&p=45463&hilit=case+redirecturl#p45463.

The only thing that won't work now is passing variables from the chronoform to the ideal-form outside joomla. It is on the same site/server.
If you have a solution for that, that would be great.
GreyHead 03 Jul, 2011
Hi h4nneke,

The post you linked to will work OK for building the redirect url. The ReDirect plug-in is the simpler way but as far as I know you can't make it conditional.

For the iDeal link you should be able to use a ReDirect URL in the same way and pass the variables in the URL.

I built a ChronoForm recently that linked to Mollie. Is that the kind of thing that you need?

Bob

PS There's some code on my site for using JavaScript to insert an remove default values from input boxes.
h4nneke 03 Jul, 2011
Oh, I feel stupid 😶
Indeed that is the kind of thing I needed. So easy...

I tried that before inside Joomla and that didn't always work well because of acesef problems. But now I need it outside Joomla. So no url problems. This will work fine for me.

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