Re: database update Combobox
- From: derek
- Date: Wed, 31 Oct 2007 11:31:10 -0500
On 10/31/2007 at 09:55:48, Clive_ <cliveswan@xxxxxxxxxxx> wrote:
Hi,
I have a combobox with values 1, 0, -1.
I want the selected item to equal the value in the database.
It may be 1, then the user changes it to 0.
You can 'read' the value from the database:
<option value=<%= rs.getInt(3)%> > </option>
How do you get the value in combobox to 'synchronise' with the
database. So if the value of rs.getInt(3) is 0.
The combox would have 0 selected.
PS got code for combobox & database from Java not JS??
Thanks
Clive
if you want a specific option to be selected, just print this html out.
<option value="whatever" selected> </option>
Note the "selected" keyword.
It will make the option show as selected.
You will want add an if check in your code to determine where to output the "selected" text though.
.
- References:
- database update Combobox
- From: Clive_
- database update Combobox
- From: derek
- Re: database update Combobox
- From: Lew
- Re: database update Combobox
- From: Clive_
- Re: database update Combobox
- From: derek
- Re: database update Combobox
- From: Clive_
- database update Combobox
- Prev by Date: Re: [OT]
- Next by Date: Re: OpenSource SOA Stack based on Apache Geronimo - GASwerk
- Previous by thread: Re: database update Combobox
- Next by thread: textpad
- Index(es):
Relevant Pages
|