wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes How to Assign a value to a Option of a Combo on the fly 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 "How to Assign a value to a Option of a Combo on the fly" Watch "How to Assign a value to a Option of a Combo on the fly" New topic
Author

How to Assign a value to a Option of a Combo on the fly

samuel marin
Greenhorn

Joined: Nov 18, 2011
Posts: 16
I have a function that creates a Combo box on the fly:





I want to be able to call the following function and execute a code base on the selection of the Combo:



I guess is not working because I don't know how to assign a value to the Combo on the fly.

Any helpt would be highly appreciate.

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61190
    
  66

Welcome to the Ranch,

samuel marin wrote:I have a function that creates a Combo box on the fly:

No. There's no such things as a "combo". I assume you mean a select dropdown? Please read: HtmlHasNoComboBox

Also, your code will be much easier to read with proper indentation. I'd suggest editing your post. Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61190
    
  66

Give the element an id value and then use document.getElementById() to reference it.
samuel marin
Greenhorn

Joined: Nov 18, 2011
Posts: 16
I was trying to delete this post so I could create an acurate one with the correction that you mentioned.

I'm still don't know how to solve my issue.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Assign a value to a Option of a Combo on the fly