Forums

Replace old form with new form on the same module position

patrick.h 20 Mar, 2019
Hi forum,

I have a module on my website with a form that has 2 input fields to be sent to a new form for a calculation to be done.
The result should be displayed in the new form on the same module position on the same page the old one was displayed.
How can I achieve this?

Thank you for your effort
healyhatman 20 Mar, 2019
Try setting the form to AJAX submit.
GreyHead 21 Mar, 2019
. . . and you could use a multi-page form.

Bob
patrick.h 21 Mar, 2019
Thank you.
Ajax submit works fine, but how does it load ONLY the new form in the module? Not the whole page
Currently I redirect (setup->submit->redirect) to another page (with transfer of the field parameters), which is then displayed in the module.

{redirect:http://......../index.php?option=com_chronoforms6&chronoform=Alter-Berechnung&alter=(data:alterBenutzerEingabe)&punkteanzahl=(data:punkteBenutzerEingabe)}
patrick.h 21 Mar, 2019
Other idea
Can I do it with a custom code in my old form with {chronoform:Alter-Berechnung}?
How is the syntax if I want to pass both variables to my new form?
{chronoform:Alter-Berechnung} and then something like this &alter=(data:alterBenutzerEingabe)&punkteanzahl=(data:punkteBenutzerEingabe)???
healyhatman 21 Mar, 2019
Answer
If you don't want it to show the whole form then add &tvout=view to the end of the URL
patrick.h 22 Mar, 2019
I want to show the whole form but not the whole site in the module.

I have two forms ("Alter-Eingabe" (age-input) and "Alter-Berechnung" (age-calc)). "Age-input" form with 2 input fields which sends this currently with a url-redirect to the other form on another page.
There, the calculation takes place and the result is displayed.
With ajax submit the whole new site with "Age-calc" form is shown in the module, but i want to show only the "Age-calc" form in the module position
healyhatman 22 Mar, 2019
Do what I said, made a mistake saying form when I meant site.
patrick.h 22 Mar, 2019
Yeeeeeees it works. Many thanks
This topic is locked and no more replies can be posted.