|
-
Aug 30th, 2007, 08:47 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Multiple selection list boxes
I am trying to get data from a few list boxes, so I set up a stringbuilder to append the value selected, but how would that work with boxes that I set to "multiple selection"?
Also, what is a more efficient way to reset a form other than settings everything to "" when the button is clicked?
EDIT: Wow, remembered the onReset="return clearFields();.
Last edited by meef; Aug 30th, 2007 at 01:22 PM.
-
Sep 2nd, 2007, 05:39 AM
#2
Re: Multiple selection list boxes
Loop through the .Items of the listbox and check for the .Selected property.
vb Code:
For Each li As ListItem in myListBox1.Items
If li.Selected = True Then
'Add to stringbuilder
End If
Next
-
Sep 6th, 2007, 11:23 AM
#3
Thread Starter
Addicted Member
Re: Multiple selection list boxes
Thanks.
So this is alright then?
vb Code:
For Each li As ListItem In lstOrgMain.Items
If li.Selected = True Then
strBody.Append("Main Campus Organizations: " & li.Selected & "")
End If
Next
-
Sep 6th, 2007, 02:54 PM
#4
Thread Starter
Addicted Member
Re: Multiple selection list boxes
Eh I guess that doesn't work... What did I do wrong? I get this as a result:
Main Campus Organizations: TrueMonroe Campus Organizations: TrueMonroe Campus Organizations: TrueIntramural Sports: TrueIntramural Sports: TrueIntramural Sports: TrueIntramural Sports: TrueIntercollegiate Sports: TrueIntercollegiate Sports: TrueIntercollegiate Sports: TrueSemester
EDIT: Duh, should be "value" and not "selected".
-
Sep 6th, 2007, 04:00 PM
#5
Re: Multiple selection list boxes
Does that edit you made mean that you solved the problem?
-
Sep 6th, 2007, 04:49 PM
#6
Thread Starter
Addicted Member
Re: Multiple selection list boxes
Yep sorry, all is well with this issue now.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|