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: 1490
    
    1
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: 61772
    
  67

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: 1490
    
    1
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: 61772
    
  67

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