Yes, you will get the "value" not the name.
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet API
Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Andras Balogh
Sent: Tuesday, October 05, 1999 9:31 AM
To: [EMAIL PROTECTED]
Subject: Re: combobox problem requires attention
Hi,
Maybe my previous message wasn't so clear.
The Sql statement we are talking about is:
select stnid,station from station;
where i presume stnid is a number(unique identifier) with
value like 1 and station is a String having a value like
"New York Bus station".
If the menu form object (<select>) is used like
below than if the user selects "New York Bus station" from the menu
and presses the submit button than the parameter recieved by the servlet
will be the stdin (ex.1) not station (ex. "New York Bus station").
p.s. In one sentence: presenting to the user the name but using the id as
paramter
value.
Hope it helps.
Best wishes,
Andras.
----- Original Message -----
From: PATIBANDA, SRIKANTH <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 05, 1999 3:35 PM
Subject: Re: combobox problem requires attention
> it is HTML
>
> But i didnt get your question. What do u mean by this...
>
> "Now if you get the parameter "station" will contain
> stnid not the name."
>
> -Pat
>
> -----Original Message-----
> From: Andras Balogh [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 05, 1999 9:15 AM
> To: [EMAIL PROTECTED]
> Subject: Re: combobox problem requires attention
>
>
> Hi,
>
> I am not sure what a combobox is.
> Is this pure HTML or an applet.
> If you are using HTML menu (<select>)
> than you can do:
> <select name="station">
> <option value="1">New York station </option>
> <option value="2">Los Angeles station </option>
> ...
> </option>
>
> Now if you get the parameter "station" will contain
> stnid not the name.
>
> Waiting for reply.
>
> Best wishes,
> Andras.
>
>
>
> ----- Original Message -----
> From: sanjeev kumar <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, October 05, 1999 2:23 PM
> Subject: combobox problem requires attention
>
>
> > Hi,
> > I hv been developing a database access application using servlets.I hv
one
> > combobox populated with the data coming from SQL say "select
stnid,station
> > from station" thru JDBC.Now user selects a station from the combobox
which
> > shows only station name and not stnid. When I submit it I can get the
> value
> > of station using req.getParameter(). I want to insert a record in a
> > different table but the value to be inserted should be stnid and not
> > station.
> > One crude approach may be to again query the database and get stnid for
> the
> > selected station.
> > But I am sure my friends out there may not like this approach. What
> > should be the method of achieving it?
> > Thanks
> > Sanjeev Kumar
> >
> > ______________________________________________________
> > Get Your Private, Free Email at http://www.hotmail.com
> >
> >
>
___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html