Forums

parameters in Chronforms

adeleon 29 Oct, 2008
I need to send a parameter when calling a chronoforms form to fill a field that will be sent with the rest of the input data.

the form is a subscription sheet for events, every event will call the form with de event id as parameter

Could anybody help me?

Thanks in advance

Arturo
Max_admin 29 Oct, 2008
Hi Arturo,

this is your form link:
index.php?option=com_chronocontact&chronoformname=formname

make it :
index.php?option=com_chronocontact&chronoformname=formname&eventid=44343

now ate your form code:
<?php
echo JRequest::getVar('eventid');
?>


cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
adeleon 29 Oct, 2008
Thank very much Max, this is a very urgent problem in my customer installation and i am a newbie
One more question: How can i send this value with the rest of the input fields?

Thanks again, max
Max_admin 29 Oct, 2008
you can put it in the value or a hidden input field!

Cheers
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
adeleon 30 Oct, 2008
Thank you Max, everything run ok
Morymmus 26 Nov, 2010
Hello,

could you please be more specific where to put your Code

Code: Select all
<?php
echo JRequest::getVar('eventid');
?>



and how to fill in the information in a given input field?

Thanks in advance
Best regards

Christian
GreyHead 26 Nov, 2010
Hi Morymmus,

I'm not completely clear what you want to do here. To get a parameter value from the URL and show it in an input you need something like this in the Form HTML
<?php
if ( !$mainframe->isSite() ) { return; }
$eventid = JRequest::getInt('eventid', 0, 'get');
?>
. . .
<input name='eventid' id='eventid' type='text' value='<?php echo $eventid; ?>' />


Bob

PS The isSite() line is not needed in the latest release of ChronoForms
Morymmus 26 Nov, 2010
Hi,

Here is my plan:

I created a table with technical data for 5 Items. For every Item there is a link to call the form I created. With clicking on this link I want to fill in a specified field with data.
I don't need dynamic grabbing.

To give you an idea I was expecting something like this:

index.php?option=com_chronocontact&chronoformname=<<Name_of_the_Form>>&<<fieldname_in_the_form>>=<<Data_to put_in_the_field>>

I hope this is an answer to your question what I want to do.

Grabbing a paramter from the URL will work as well, I think. I will try this next.
Are there any restrictions to the Data grabbed from the URL? Like lowercase only, or no spaces?

Thanks again for your fast response and your help

Best regards

Christian
GreyHead 26 Nov, 2010
Hi Morrmmus,

With clicking on this link I want to fill in a specified field with data.

That is the code I've just posted for you.

Are there any restrictions to the Data grabbed from the URL? Like lowercase only, or no spaces?

If you want to include spaces or special characters then the value must be urlencoded.

Bob
Morymmus 26 Nov, 2010
Thanks again,

I just found the place where to copy the code and - voila: thats it.
Works just great.

I changed "...JRequest::getInt(..." to "...JRequest::getString(..." to fit to the Data I want to transfer.

Two thumbs up for your professional help, thanks!

Christian
This topic is locked and no more replies can be posted.