sorry i don't know th correct word so I use url-tag.
What i meen is if I go to for example
index.php?option=com_chronocontact&chronoformname=xxxx&Itemid=141&field1=John&fireld2=Doe
the field named field1 will be prefilled with "John" and field2 with "Doe"
is that possible somehow?
What I actually want to do is have a small html-form in a module where the customer chooses a arrival date and number of persons, nights to stay, then when he/she presses "the button" it will bring up the whole form/chronoform in content area with some fields prefilled from the form before.
What i meen is if I go to for example
index.php?option=com_chronocontact&chronoformname=xxxx&Itemid=141&field1=John&fireld2=Doe
the field named field1 will be prefilled with "John" and field2 with "Doe"
is that possible somehow?
What I actually want to do is have a small html-form in a module where the customer chooses a arrival date and number of persons, nights to stay, then when he/she presses "the button" it will bring up the whole form/chronoform in content area with some fields prefilled from the form before.
Hi sailor,
do you have control over this small form action tag ?
or using the idea you need, yes you can do this, in the value="" attribute of any field, write this :
<?php echo $_GET['field1']; ?>
Cheers
Max
do you have control over this small form action tag ?
or using the idea you need, yes you can do this, in the value="" attribute of any field, write this :
<?php echo $_GET['field1']; ?>
Cheers
Max
Hi sailor,
You can pass variable info in the url as Max said. But it's probably easier, and maybe safer to re-show the same form page with a different set of fields. Then you can pass the info back in the $_POST array.
You can put a hidden variable in your form to control what is displayed. Call it 'page', to start with page has no value and you set it to value='1' on the basic form.
Bob
You can pass variable info in the url as Max said. But it's probably easier, and maybe safer to re-show the same form page with a different set of fields. Then you can pass the info back in the $_POST array.
You can put a hidden variable in your form to control what is displayed. Call it 'page', to start with page has no value and you set it to value='1' on the basic form.
<?php
switch ( $_POST['page'] ) {
case "":
// show basic form
break;
case '1':
echo "Hello user $_POST['name'],<br />
your details are . . .";
break;
}
?>and in your 'OnSubmit after' field you can process the form data and then re-show the form<?php
// some processing
showform($_POST);
?>This is a simplified example but the approach works well.
Bob
This topic is locked and no more replies can be posted.
