Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fergus Davidson 309 posts 588 karma points
    Nov 08, 2010 @ 17:18
    Fergus Davidson
    0

    Set value of radiobuttonlist from querystring

    hi i am using umbraco 4.5.2 with contour 1.1.1

    i am linking to a form from a number of locations. i am currently passing a querystring in the link to the form page and want to select an option in a radiobuttonlist which corresponds to that value.

    it works with the value direct into the field but i cannot seem to pick it up from the querystring

    is it possible?

    any suggestions?

  • Comment author was deleted

    Nov 15, 2010 @ 13:38

    it should work if you have the correct syntax, in the default value input set it to [@requestValueKey]

  • Kim Løwert 130 posts 116 karma points
    Nov 19, 2010 @ 13:04
    Kim Løwert
    0

    Hey Tim

    I have entered [@query] in the default value on a Contour form field, but when the form loads it actually contains [@query] instead of the value passed in on the query string - e.g. ?query=test

    Am I doing it correctly???

    I'm using v4.5.2 on .Net 4.0

  • Comment author was deleted

    Nov 19, 2010 @ 16:46

    @Kim, what version of Contour are you running ?

  • Kim Løwert 130 posts 116 karma points
    Nov 19, 2010 @ 16:50
    Kim Løwert
    0

    Hi Tim,

    Thanks for the reply. I updated Contour and now it works as you specified :)

    Best regards

    Kim :)

  • Fergus Davidson 309 posts 588 karma points
    Nov 24, 2010 @ 09:16
    Fergus Davidson
    0

    Works for me too, thanks tim

  • Josh Reid 182 posts 258 karma points
    Jan 06, 2013 @ 07:43
    Josh Reid
    0

    Hi Tim
    This appears to be an issue again in 4.11.1 using contour 3.0.4 with a razor form.

    [#pageID] works, but [@requestValueKey] and [%sessionKey] don't.

    Thoughts?
    Josh

  • Comment author was deleted

    Jan 07, 2013 @ 09:46

    @Josh will check it out

  • Comment author was deleted

    Jan 07, 2013 @ 09:48

    @Josh, just tested and it works like expected, any more details on a setup that doesn't work?

  • Josh Reid 182 posts 258 karma points
    Jan 07, 2013 @ 10:00
    Josh Reid
    0

    @Tim, Thanks!

    I have just done some further testing and the value does come when using a key that is longer than 1 char.

    I was using [@p] & [%b] with no luck - hence the question... but have made [@pr] now with result as expected.

    Sorry for your time, though it may be a quirk? Unless querystring 'p' is somehow reserved, etc - haven't tried with the cookie yet but assume making at least 2 chars will resolve as well.

    Thanks
    J

  • Comment author was deleted

    Jan 07, 2013 @ 10:41

    Yeah sounds like a quirk, thanks for the extra details :)

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    May 21, 2013 @ 09:50
    Ismail Mayat
    0

    Tim,

    I have a drop down list which is populated from prevalues and the prevalues source is umbraco nodes.  I have a link to the form page looks like:

    /contact-us/?location=Manchester

    In contour for my office location field I have in default value  [@location]  I am using umbraco 4117 and latest version of contour downloaded from our.

    Any ideas?

    Regards

     

    Ismail

     

  • Josh Reid 182 posts 258 karma points
    May 21, 2013 @ 10:08
    Josh Reid
    0

    Hey Ismail
    Have you tried passing the nodeId rather than nodeName in the query string?

    Just from memory I think using the umbraco nodes prevalue source stores the id- might be wrong but could be a quick fix...

    Cheers
    Josh

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    May 21, 2013 @ 10:12
    Ismail Mayat
    0

    Josh,

    The prevalues is writing out node name and not id. The form is being written out using razor macro and i suspect thats where the issue is. I am just looking at the contourform.cshtml and there is nothing in there about querystring test and pre fill.  Time for some hacking lol!!

    Regards

     

    Ismail

  • Josh Reid 182 posts 258 karma points
    May 21, 2013 @ 10:29
    Josh Reid
    0

    Check with Tim as this should work OOTB, but yeah a quick razor or jQuery hack would be pretty easy! Get stuck in I say ;)

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    May 21, 2013 @ 10:35
    Ismail Mayat
    0

    Josh sorted.

    It was that the razor views was not checking for querystring parameter. So I created new view for this form and then added new razor for dropdown field type just for this form and it all works. I love it full control over the markup wow just wow!!!

  • Josh Reid 182 posts 258 karma points
    May 21, 2013 @ 10:43
    Josh Reid
    0

    Isn't it sweet- loving markup control and the codefirst production!

    Can you log the issue: http://issues.umbraco.org/issues/CON

    So Tim can make sure to review/roll this into a release, etc.

    Cheers
    Josh

Please Sign in or register to post replies

Write your reply to:

Draft