on 04-25-2011 10:48 AM
Hi Guys,
I am trying to populate values in the dropdown list in javascript.
I know how to populate manually using SELECT and pushing the values manually through OPTIONS. I dont want to do it manually. B'cos every time user introduces new value I need to change the code and hard code it in the program.
I need to get the list from a DB table, i.e., when ever a new value is added to the table that should be automatically included in our list.
I can get the details from the database table and keep it in a internal table.
I need to populate this list using this internal table.
Can you please tell me how I should use this internal table to add in the list in javascript.
Thx
Mohan
This is pretty basic stuff Mohan - perhaps you should start to read the documentation, the Wiki, etc. to learn this yourself?
Anyway, if you don't want to use the supplied HTMLB extension for the dropdown listbox you can do something like this.
select id="dropdown1">
<% loop at itab reference into ref. %>
<option><%= ref->value%></option>
<% endloop. %>
Cheers
Graham Robbo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Robinson,
The one you told is very good.
I have already done loop... endloop in HTML.
I need to use this loop... endloop in javascript. If you have replied my question to be in javascript then please do send me the link where it is used.
As I am finding difficult to declare " reference into ref".
<% loop at itab reference into ref. %>
<option><%= ref->value%></option>
<% endloop. %>
Can you please explain the logic to put loop.. endloop in javascript.
Mohan
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.