is it possible to fill form with "url-tags"

sailor 23 May, 2008
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.
Max_admin 23 May, 2008
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
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 25 May, 2008
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.
<?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.