Passing a parameter to a form

simonshah 13 Nov, 2007
I looked on the forum for an answer to this but could not find it. I am creating a form on Joomla and want an hidden form field called 'leadsource'. I want to pass a url to go to the page where this form is embedded on a Joomla page and populate the hidden form field with an entry. Something like 'tradeshow' or 'januaryemailblast' etc.

The context behind this is that I want to identify the source of the lead that completed the form.

My workaround thus far has been to create several forms with every posible combination of hidden leadsource and link to the relevant form. This is clearly not the most intelligent way to build the forms and I am sure there must be a way around this.

Excuse me, I am a newbie to this but if I could have general instructions on how to achieve I should be able to fix.

thankyou
GreyHead 13 Nov, 2007
Hi simonshah,

I think that the info from your hidden fields will be available to the ChronoForms module when it creates the form code in the $_POST array.

Test this out by putting
<?php echo $_POST; ?>
into the form html. When you connect to it from one of your links then the array contents should display on the page (it will be a mess but that doesn't matter for the test).

Note: if you are putting the info into the URL then you'll need to test $_GET in the same way.

Once you've checked that your data is available then you can include it in your form with
<input type="hidden" name="leadsource" value="<?php echo $_POST['leadsource']; ?>" />
Bob

Post edited by: GreyHead, at: 2007/11/13 15:39<br><br>Post edited by: GreyHead, at: 2007/11/13 15:39
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger