We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum
Perch variable in a form is being 'urlified'
I am passing a Course Title into a form as a variable, but on receiving the form submission the Course Title is formatted like a slug, rather than normal text (with capitals and spaces).
eg. Instead of 'Equine Veterinary Course', I get 'equine-veterinary-course'.
I create the variable like this:
$result = perch_content_custom('Courses', array( 'page'=>'/continued-professional-development/index.php', 'skip-template'=>true, 'count'=>1, 'filter'=>'slug', 'match'=>'eq', 'value'=>perch_get('course'), ),true); PerchSystem::set_var('course_title', $result['title']); perch_form('cpd_booking_form.html'); ?>
Then call it in the form like this:
<perch:input type="hidden" id="course" label="Course" value="<perch:forms id="course_title" />" />
If I echo
$result['title'] on the page, or even in the template, it shows as: 'Equine Veterinary Course' so I'm confident that the variable is set correctly. But on submitting, the hidden input shows like a 'slug'.
Want to reply to this thread?Login with Perch