Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted

look at doing it in the code...

 

there is a .SelectedItem.Text property on each checkbox item in the list

If you make it idiot proof, they'll build a better idiot :-)
Posted
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.

Posted

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

"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

Posted
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.

Posted

Damn... what a ****.

A so big solution for a so little problem ?

Should be another way of doing this...

Anyway! good luck

 

stay Zen !

"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

Posted
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?

If you make it idiot proof, they'll build a better idiot :-)
Posted

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

If you make it idiot proof, they'll build a better idiot :-)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...