Re: Can I make a dynamic list box from DB results




<mike.a.rea@xxxxxxxxx> wrote in message
news:1164730481.933011.207330@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a JSP page that returns a set of several different values from a
db table. I can show these in tabular format without a problem.

However I was wondering if there was a way that I could use the
information in a drop down list box, maybe use one variable as the Item
Label and another one as the Value.

Any ideas on how I can do this? Thanks in advance.


If you know how to do this in a tabular format, presumably, you have code
which emits something like:

<table>
<tr><td>VALUE A</td></tr>
<tr><td>VALUE B</td></tr>
</table>

So change your code so that it instead outputs:

<select>
<option>VALUE A</option>
<option>VALUE B</option>
</select>

As for the issue of using a label versus a value, the value attribute has no
equivalent in a table, so I'm not sure what you intend to do there.

- Oliver


.



Relevant Pages

  • Re: Can I make a dynamic list box from DB results
    ... However I have several different data fields being returned from the ... I can show these in tabular format without a problem. ... Label and another one as the Value. ... which emits something like: ...
    (comp.lang.java.programmer)
  • Re: Can I make a dynamic list box from DB results
    ... However I have several different data fields being returned from the ... I can show these in tabular format without a problem. ... Label and another one as the Value. ... which emits something like: ...
    (comp.lang.java.programmer)