aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes JQuery to Iterate Over Select List Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "JQuery to Iterate Over Select List" Watch "JQuery to Iterate Over Select List" New topic
Author

JQuery to Iterate Over Select List

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
For what ever reason the following will only return a value if an element is selected and then only that element.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

That's an id selector, so there can be only one element with that id. So why bother iterating over it?

If you have more than one element with the same id, that's not valid HTML and whatever happens is non-deterministic.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
Bear Bibeault wrote:That's an id selector, so there can be only one element with that id. So why bother iterating over it?

If you have more than one element with the same id, that's not valid HTML and whatever happens is non-deterministic.


I did not have the selector set up right. I had to add 'options' to it and it worked.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

If you have more than one element with the same id, it's guaranteed to stop working at the most inopportune time. Be sure that there is only one element with a unique id value.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JQuery to Iterate Over Select List
 
Similar Threads
Multiple Selection boxes of same width
select a value from a drop down menu bar in a HTML page
alert() is changing script function
how to order a combo box with numbers in it
how to open xml file into html page