aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Javascript Dynamic Dropdown Box validation 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 "Javascript Dynamic Dropdown Box validation" Watch "Javascript Dynamic Dropdown Box validation" New topic
Author

Javascript Dynamic Dropdown Box validation

Prasath Arjunan
Greenhorn

Joined: Jan 05, 2011
Posts: 3
Hi,

I need a JavaScript Validation for Dynamic Drop Down Box when clicking the submit button. But the drop down box attribute name and id should be same for all drop down boxes. I tried below code but its not succeeded, its work well when there are multiple drop down box but its does not work when there is only one drop down box. Please help me for find out this problem or give me any suggestion without changing of attribute name and id of drop down box.




Thanks in Advance,

Prasath Arjunan.
Albareto McKenzie
Ranch Hand

Joined: Apr 08, 2009
Posts: 298
Id should be unique, why would you want to have the same id for different elements?
Prasath Arjunan
Greenhorn

Joined: Jan 05, 2011
Posts: 3
No, it should not be unique...both id and name, because i cant generate unique id.
Albareto McKenzie
Ranch Hand

Joined: Apr 08, 2009
Posts: 298
No, really, it should be unique, other thing is that you don't want to make it unique, but imagine you are going to travel by plane and another guy has the same ticket number that you have, what happends?

A workarround if you want to do it this way is use the getElementsByTagName('select') but I would try to have unique ids as I have told you before.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60056
    
  65

If your ids are not unique, your HTML is invalid and you will have nothing but endless troubles.

Your id values must be unique!


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Prasath Arjunan
Greenhorn

Joined: Jan 05, 2011
Posts: 3
Hi,

Thanks a lot... I have resolved this solution with the getElementsByTagName('select')
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javascript Dynamic Dropdown Box validation
 
Similar Threads
spaces while populating using s:iterator
Getting search results on same search page
Rounding off $$ amounts
How to sort List Box
document.getElementById("id").value is not supported in firefox