Forum

Thread tagged as: Events, Forms

Do anyone know if the above example (Drew's most recent code example) actually works?

I'm trying to do something very similar - insert a custom series of options into a <perch:input type="select" /> tag - but when the form renders the select is empty.

In my code I have:

PerchSystem::set_var('course_options', $course_options);
perch_content('Event booking form');

($course_options is a comma-delimited string)

In my template I have:

<perch:input type="select" id="course" label="Course" options="<perch:content id="course_options" type="hidden" />" />

(I have to use type="hidden" to prevent the field showing up in the CMS UI)

Is there something I haven't got quite right?

Thanks - any help appreciated.

Jon

Answering myself, here.

Yes, it does work. Didn't realise variable substitution only works with perch_content_custom, though.