aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes How to get total count of selected Items of <Select> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to get total count of selected Items of <Select>" Watch "How to get total count of selected Items of <Select>" New topic
Author

How to get total count of selected Items of <Select>

ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 214
HI ,
How to get all index of selected items in multiselect box
<select name="s1" multiple>
<option value"1">one</option>
<option value"2">two</option>
<option value"3">three</option>
<option value"4">four</option></select>

suppose i am selecting all four iteam then how can i get index of all selected items??

selectedIndex retruns only first element selected...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60072
    
  65

Iterate over the options looking for those with the selected attribute.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 214
thanks ...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get total count of selected Items of <Select>
 
Similar Threads
Getting an Option object from Select Object using JavaScript
Replacing the drop down box to text field
ComoboBox values
Firefox doesn't show background color for selected option
How to set Default selection in h:selectOneMenu