aspose file tools
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
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply 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: 7
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: 56157
    
  13

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56157
    
  13

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

Joined: Nov 18, 2011
Posts: 7
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to Assign a value to a Option of a Combo on the fly
 
Similar Threads
get all from select multiple
Recognizing a Form
Assign a value to a Option In a Select dropdown on the fly
How to call a function within a function.
How to get values from a dropdownlist