Quantcast
Channel: BIRT Exchange Forum Feed
Viewing all articles
Browse latest Browse all 542

Read data form dataset with JavaScript

$
0
0
Hi all,

I would like to know what is the easiest way to read data from a data-set by using Javascript?

What I'm trying to do is:
I have a query that return a list of ages
Query Text:
SELECT age as ages, age_code AS code
FROM table1



Query return value:
  age   | code
--------------
 0 - 18 |  1
19 - 30 |  2
31 - 50 |  3
   51+  |  4



What I would like to do is to create a drop-down list that will have all those values.
Meaning that the value will be equal to the code and the text will be equal to the age.

For example, if I where to write the drop down manually the code will be like that:
<select id="list1">
  <option value="default"></option>
  <option value="1">0 - 18</option>
  <option value="2">19 - 30</option>
  <option value="3">31 - 50</option>
  <option value="4">51+</option>
</select>



The main issue is to create a scenario that is completely automatically, because the ages values or code can change and I do not want to have to make change is the HTML code as well every time

I have tried many ways to do that but without much success,
Please help me
Thanks a lot
Shlomi

Viewing all articles
Browse latest Browse all 542

Trending Articles