alemargo Posted March 29, 2004 Posted March 29, 2004 Hi, What I am trying to acheve is when user checkes several items from CheckBoxList, I want to show which items were checked. The problem raises when I try accessing items of the CheckBoxList from JavaScript. The text values are rendered as part of LABEL tag, and I cannot find any way to access LABEL tag from JavaScript. The LABEL tag does not carry any ID or NAME. If anyone came across this, please share your findings with me. Thanks. Quote
MorningZ Posted March 29, 2004 Posted March 29, 2004 look at doing it in the code... there is a .SelectedItem.Text property on each checkbox item in the list Quote If you make it idiot proof, they'll build a better idiot :-)
alemargo Posted March 29, 2004 Author Posted March 29, 2004 look at doing it in the code... there is a .SelectedItem.Text property on each checkbox item in the list Yeah, but I cannot really use 'javascript:confirm()' with that. The whole purpose of this excersize is to ask user to confirm selection using client side script. Thanks anyway. Quote
Arch4ngel Posted March 30, 2004 Posted March 30, 2004 Hummmm... I know that a CheckListBox doesn't exist on the client side. There's only CheckBox. So checked them individually on the client side with a script. N.B.: If you have a Form and that you submit... selected coupe "Name=Value" will be in the adress bar Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
alemargo Posted March 30, 2004 Author Posted March 30, 2004 Hummmm... I know that a CheckListBox doesn't exist on the client side. There's only CheckBox. So checked them individually on the client side with a script. N.B.: If you have a Form and that you submit... selected coupe "Name=Value" will be in the adress bar The CheckBoxList gets rendered into table with checkboxes and their VALUES are located under LABEL tags. Anyway, I just learned from Microsoft support site, there is a known bug in DropdownList, CheckBoxList, RadiobuttonList. Basically, if you add a pair value attribute to a ListItem, it does not get rendered as to a client. Their suggestion is to create custom control, derive it from ..List and implement additional attributes functionality. Quote
Arch4ngel Posted March 30, 2004 Posted March 30, 2004 Damn... what a ****. A so big solution for a so little problem ? Should be another way of doing this... Anyway! good luck stay Zen ! Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
MorningZ Posted March 30, 2004 Posted March 30, 2004 The CheckBoxList gets rendered into table with checkboxes and their VALUES are located under LABEL tags. Anyway' date=' I just learned from Microsoft support site, there is a known bug in DropdownList, CheckBoxList, RadiobuttonList. Basically, if you add a pair value attribute to a ListItem, it does not get rendered as to a client. Their suggestion is to create custom control, derive it from ..List and implement additional attributes functionality.[/quote'] got a link to this support page? Quote If you make it idiot proof, they'll build a better idiot :-)
alemargo Posted March 30, 2004 Author Posted March 30, 2004 got a link to this support page? http://support.microsoft.com/default.aspx?scid=kb;en-us;309338 Quote
MorningZ Posted March 30, 2004 Posted March 30, 2004 damn, i was hoping it would show some code to "Overrride" the list item stuff... i've also run into the problem of wanting to add attributes to CheckBoxListItems, and kept hearing that rolling your own was the solution... but never ever found/seen an example of doing so.... Quote If you make it idiot proof, they'll build a better idiot :-)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.