Form: http://www.celevt.nl/formtest
Hi,
I have a Multi page form which functions just fine. I need however to copy data from one page to the next based on the users choice in a checkbox on the previous page.
The java examples on the website works like a charm but only if you copy data on the same page. I’am now wondering how to do this with a multi page form.
Kind regards,
CELEVT
Hi,
I have a Multi page form which functions just fine. I need however to copy data from one page to the next based on the users choice in a checkbox on the previous page.
The java examples on the website works like a charm but only if you copy data on the same page. I’am now wondering how to do this with a multi page form.
Kind regards,
CELEVT
Hi Bob,
Thanks for the swift reply. I used the FAQ to create the form and the multi page setup works like a charm :-).
However when the checkbox on the first page is clicked the data on the next page is not updated. When I use the script below for an field on the same page it all works fine, but when the field is on the next page nothing is updated. I must be missing something here... could you have a look at the simplified script below?
Thanks for the swift reply. I used the FAQ to create the form and the multi page setup works like a charm :-).
However when the checkbox on the first page is clicked the data on the next page is not updated. When I use the script below for an field on the same page it all works fine, but when the field is on the next page nothing is updated. I must be missing something here... could you have a look at the simplified script below?
window.addEvent('domready', function() {
$('copy_ctod').addEvent('click', function() {
if ( $('copy_ctod').checked ) {
$('d_voornaam.value').value = 'TEST OF SCRIPT WERKT';
}
});
});
Hi celevt,
I'm sorry, I'm lost . . . What exactly is the problem. That the checkbox isn't checked on the second page - or the JavaScript doesn't work when the checkbox is clicked?
Bob
I'm sorry, I'm lost . . . What exactly is the problem. That the checkbox isn't checked on the second page - or the JavaScript doesn't work when the checkbox is clicked?
Bob
Hi Bob,
I gues the JavaScript does not work. When the checkbox is clicked on the first page à value should be entered into à field on the second page.
I hope this is clear enough of you need more info please ask again.
Kind regars,
Bart
I gues the JavaScript does not work. When the checkbox is clicked on the first page à value should be entered into à field on the second page.
I hope this is clear enough of you need more info please ask again.
Kind regars,
Bart
Hi Bart,
Please drag a Debugger action into the On Load event on the second form, then submit the first form and post the debug results here.
Bob
Please drag a Debugger action into the On Load event on the second form, then submit the first form and post the debug results here.
Bob
Hi Bob,
Below you will find the debugger information of the page two event. I'am a bit suprised that[d_voornaam] is not in the array while a value is set in the java script.
Any ideas?
Thanks,
Bart
Array
(
[chronoform] => mcpov4
[event] => Pagina twee
[cf_sid] => 3f8a53e2e58d7947ec90b97cc17c4690
[Itemid] => 201
[option] => com_chronoforms
[view] => form
[a_referentiecode] =>
[a_evenement] => Masterclas duplo voor gevorderden
[a_datum] => 01-01-9999
[a_prijs] => Prijs
[c_voornaam] => cx vc
[c_achternaam] => zxcmnvznx
[c_organisatie] => zxnvcmz
[c_telefoon] => 888
[c_email] => [email]bwboerman@gmail.com[/email]
[copy_ctod] => 1
[input_submit_5] => Volgende
[d2877cf131816cdb5922c1f991b72057] => 1
)
Validation Errors:
Array
(
)
Below you will find the debugger information of the page two event. I'am a bit suprised that[d_voornaam] is not in the array while a value is set in the java script.
Any ideas?
Thanks,
Bart
Array
(
[chronoform] => mcpov4
[event] => Pagina twee
[cf_sid] => 3f8a53e2e58d7947ec90b97cc17c4690
[Itemid] => 201
[option] => com_chronoforms
[view] => form
[a_referentiecode] =>
[a_evenement] => Masterclas duplo voor gevorderden
[a_datum] => 01-01-9999
[a_prijs] => Prijs
[c_voornaam] => cx vc
[c_achternaam] => zxcmnvznx
[c_organisatie] => zxnvcmz
[c_telefoon] => 888
[c_email] => [email]bwboerman@gmail.com[/email]
[copy_ctod] => 1
[input_submit_5] => Volgende
[d2877cf131816cdb5922c1f991b72057] => 1
)
Validation Errors:
Array
(
)
Hi Bart,
I don't think that there is an input with the name or id of d_voornaam in the first form; there is a c_voornaam though.
Bob
I don't think that there is an input with the name or id of d_voornaam in the first form; there is a c_voornaam though.
Bob
Hi Bob,
That's correct lol :? ..
However what I want to achieve is a update of d_voornaam on page 2 based on c_voornaam on page 1. Is this possible?
The script works if I update c_voornaam but does not achieve updating a field on page 2.
Kind regards,
Bart
That's correct lol :? ..
However what I want to achieve is a update of d_voornaam on page 2 based on c_voornaam on page 1. Is this possible?
The script works if I update c_voornaam but does not achieve updating a field on page 2.
Kind regards,
Bart
Hi Bart,
In the On Submit event of the first form add this code snippet:
Bob
In the On Submit event of the first form add this code snippet:
<?php
$form->data['d_voornam'] = $form->data['c_voornam'];
?>
That should to it.Bob
Hi Bob,
Almost there… The data is entered into the data array, d_voornaam is now populated with the value from c_voornaam in the previous page.
But the value is not displayed in the form field d_voornaam.
Best regards,
Bart
Data Array:
Array
(
[chronoform] => mcpov4
[event] => Pagina twee
[cf_sid] => 3185d11b84b8cf5a00299fd33c533b48
[Itemid] => 201
[option] => com_chronoforms
[view] => form
[a_referentiecode] =>
[a_evenement] => Masterclas duplo voor gevorderden
[a_datum] => 01-01-9999
[a_prijs] => Prijs
[c_voornaam] => Bart
[c_achternaam] => bbb
[c_organisatie] => bbb
[c_telefoon] => 888
[c_email] => [email]bwboerman@gmail.com[/email]
[copy_ctod] =>
[input_submit_5] => Volgende
[3e0db2e081b6f1ebe53a1775547c00ea] => 1
[d_voornaam] => Bart
)
Validation Errors:
Array
(
)
Almost there… The data is entered into the data array, d_voornaam is now populated with the value from c_voornaam in the previous page.
But the value is not displayed in the form field d_voornaam.
Best regards,
Bart
Data Array:
Array
(
[chronoform] => mcpov4
[event] => Pagina twee
[cf_sid] => 3185d11b84b8cf5a00299fd33c533b48
[Itemid] => 201
[option] => com_chronoforms
[view] => form
[a_referentiecode] =>
[a_evenement] => Masterclas duplo voor gevorderden
[a_datum] => 01-01-9999
[a_prijs] => Prijs
[c_voornaam] => Bart
[c_achternaam] => bbb
[c_organisatie] => bbb
[c_telefoon] => 888
[c_email] => [email]bwboerman@gmail.com[/email]
[copy_ctod] =>
[input_submit_5] => Volgende
[3e0db2e081b6f1ebe53a1775547c00ea] => 1
[d_voornaam] => Bart
)
Validation Errors:
Array
(
)
Hi celevt,
It all looks OK. Is the Republisher set on in the Show HTML action? (it should be by default). And is the Session to Data action in Form 2 before the Show HTML action?
Bob
It all looks OK. Is the Republisher set on in the Show HTML action? (it should be by default). And is the Session to Data action in Form 2 before the Show HTML action?
Bob
Hi Bob,
Cheers 🤣 , thanks for your advise
Solution:
Republisher set on in the Show HTML action for page 2, disabled for page 1 for privacy reasons
Session to Data action for page 2 before the Show HTML action
Custom php code for page 2 before the session to data
Php code (based on radio box)
Cheers 🤣 , thanks for your advise
Solution:
Republisher set on in the Show HTML action for page 2, disabled for page 1 for privacy reasons
Session to Data action for page 2 before the Show HTML action
Custom php code for page 2 before the session to data
Php code (based on radio box)
<?php
if ( $form->data['c_cisd']='Ja' ) {
$form->data['d_voornaam'] = $form->data['c_voornaam'];
}
?>
This topic is locked and no more replies can be posted.