• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
ravindra patil
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iterate over the options looking for those with the selected attribute.
 
ravindra patil
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic