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...
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.
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
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
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
is working on a reply...