Last post May 21, 2008 10:38 AM by xcopyASP
May 21, 2008 09:56 AM|AxleWack|LINK
I have a checkbox list, with about 13 + Items to select..... What I want to do, is when I click on the 4th item, it pops up another checkboxlist, giving it further choices. But when I unselect it, I wantthe "newly" appeared checkboxlist to dissapear.....
but It gives me an error saying "Cannot convert String"" to double"
The code I use is,
If Chkboxlist1.selectedvalue = 4 then
chkboxlist2.visible = true
chkboxlist2.visible = false
Could comeone please assist me, thank you
May 21, 2008 10:29 AM|anthonypj|LINK
try placing brackets around the value ie
If Chkboxlist1.selectedvalue = "4" then
May 21, 2008 10:34 AM|anthonypj|LINK
if you are trying to determine the index of the slect item in the list you need to use
CheckBoxList1.SelectedIndex other use selectedvalue but this defaultly return a STRING which is why you are facing the issue you have
May 21, 2008 10:38 AM|xcopyASP|LINK
I was able to add and remove checkBoxes dynamicly with the following code... but I'm not sure if this is what you're looking for. PLUS there's a small bug in my code where if you click anywhere it will remove the last checkBox. easily fixed but I thought
this could help you in what you wanted to do ...
make sure your checkBoxlList control has it's AutoPostBack = TRUE
currentPosition = CBL.Items.Count - 1
cbName += 1