Copied to clipboard

Flag this post as spam?

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


  • Aron Gamble 63 posts 76 karma points
    Apr 27, 2009 @ 23:09
    Aron Gamble
    0

    Accessing CheckboxList values

    Newbie question here:-

    I have a checkboxlist on numerous doc types and need to get the values (i can get the text) of the selected items so i can see if a value has been selected. The list looks similiar to this:-

    Value Text
    63 ABC
    64 DEF
    65 ABC DEF

    The value i'm testing for is DEF...

    I am using the 'contains' function in XSLT at the moment but the text descriptions are clashing so i want to get the corresponding value and check that instead. I can't find anything that will get me the values...

    Any help would be much appreciated as i'm losing the will to live...

    Thanks in advance...

    Aron

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Apr 28, 2009 @ 10:39
    Ismail Mayat
    0

    Aron,

    There are 2 methods in xslt:

    [code]

    umbraco.library:GetPreValues

    umbraco.library:GetPreValueAsString


    [/code]

    you pass them id of data type and you get the values however you need to do the opposite, you have text value and you need number value, the only way i can think of getting round this is to write your own xslt function that does a query on the db, not sure what the query would be but you could look at code for the above functions and see if that helps. The only potential issue on any look up query is if you have 2 data types and both had a value DEF then you will get back two results.

    Regards

    Ismail

  • Aron Gamble 63 posts 76 karma points
    Apr 28, 2009 @ 10:53
    Aron Gamble
    0

    Thanks for that, i'll get the client to rename the required entries for now so they are unique but will look into an extension later.

    Cheers

    Aron

Please Sign in or register to post replies

Write your reply to:

Draft