Retrieving GET parameter into Form [Solved]
Is there a way to retrieve a get parameter into a Form Generator form?
When {{env::request}} is used as a field value in the form generator I can have a text field fill with
Quote:
contact-us.html?booking=2010-07-14&id=7
for example.
What I want is JUST to get the value of booking (ie: 2010-07-14)
I'm wondering if it is worth asking for a new insertag that could do it...like {{getquery::parameter}} ... i'm not sure how they work.
In my case I pass a date from a booking calender to a contact form via a link with the above querystring, but i'm not sure how to have the enquiry form autofill the date.
Re: Retrieving GET parameter into Form
Re: Retrieving GET parameter into Form
And combined with Andreas's http://www.contao.org/extension-list....html#new-name Calendar extension.....Bingo!
Re: Retrieving GET parameter into Form [Solved]
Hi ramjet
Could you provide an example (the code) how you solved it?
Re: Retrieving GET parameter into Form [Solved]
Using the Inputvar extension I just put {{get::booking}} as the default value in my FormGenerator "startDate" field, this extracts 2010-07-14 from the url querystring passed from a constructed URL
Example:
Quote:
contact-us.html?booking=2010-07-14&id=7
Similarly {{get::id}} would extract 7, or I could pass and capture any other info I wished
The calandarfield extension means I can make "startDate" a field type of "Calendarfield" in the FormGenerator.... which means it will show a datepicker next to the field in the Frontend contact form I've made.
Both are very small, very useful extensions by Andreas.