I hope I can make this clear, please bear with me.
I would like to populate a text field value with a value pulled from a URL query string. I am creating a registration form for various courses. Currently, I have a page displaying all the available courses, their dates and locations. When a user clicks on the corresponding registration link I would like them to be taken to a form for registration, using eForm.
I have my link working correctly now it will send the following information:
http://www.somepage.com/registration-page?cn=course name&cd=course date&cl=course location
On the registration page I have been able to display the information back to the page using the following snippet
<?php
/* testsnippet
usage: call uncached
[!testsnippet!]
*/
$output ='';
$cdate = isset($_GET['cd']) ? $_GET['cd'] : 'cdate not found';
$cname = isset($_GET['cn']) ? $_GET['cn'] : 'cname not found';
$clocation = isset($_GET['cl']) ? $_GET['cl'] : 'clocation not found';
$output .='<p><strong>Course Date:</strong> '.$cdate.'</p>';
$output .='<p><strong>Course Name:</strong> '.$cname.'</p>';
$output .='<p><strong>Course Location:</strong> '.$clocation.'</p>';
return $output;
?>
I tried to use something similar for my form field, but it doesn’t work correctly. For instance if the course was called "Jumping Jacks", the form field would only be populated with "Jumping". It seems that as soon as it hits a space in the string it terminates.
Has anyone successfully done something like this? Any help would be greatly appreciated.