Results 1 to 5 of 5

Thread: Retrieving GET parameter into Form [Solved]

  1. #1
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default 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
    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:arameter}} ... 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.

  2. #2
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Retrieving GET parameter into Form

    Found this one, i'll try it out (thanks Andreas)
    http://www.contao.org/extension-list....html#new-name

  3. #3
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Retrieving GET parameter into Form

    And combined with Andreas's http://www.contao.org/extension-list....html#new-name Calendar extension.....Bingo!

  4. #4
    User
    Join Date
    07-26-09.
    Posts
    175

    Default Re: Retrieving GET parameter into Form [Solved]

    Hi ramjet

    Could you provide an example (the code) how you solved it?

  5. #5
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default 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:
    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •