Insert website URL into form record

pbeckermann 14 Sep, 2010
I'm sorry if someone already posted this but i was unable to find a solution in the forum.
I want to have a form that can insert the complete URL of the current page when the form is submitted. For instance if I have one form called "Quick Quote" and I put this same form on 20 pages for cars, i want to be able to see in the record which car the users was interested in.

Thanks for your help.
GreyHead 14 Sep, 2010
Hi pbeckermann,

Please see this post and the rest of that thread.

Although Maurice wanted to save the title, personally I'd save the article id and look up whatever info I needed using that.

Bob

PS This is explained in more detail in Chapter 6 of The ChronoForms Book in the recipe "Showing your form on selected pages using
the ChronoForms module"
pbeckermann 21 Sep, 2010
Thanks Bob, I tried this method but was unable to get it to work. the $vehicle field is just blank.
Here is my code

<?php
if ( !$mainframe->isSite()) {return;}
$var = JRequest::getVar('vehicle', '0', 'get');
?>

<input type='hidden' id="vehicle" name='vehicle' value='<?php echo $vehicle; ?>' />
GreyHead 24 Sep, 2010
Hi pbeckermann,

You've used $var instead of $vehicle in this line:
$var = JRequest::getVar('vehicle', '0', 'get');
should be
$vehicle = JRequest::getVar('vehicle', '0', 'get');


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