Suon, Tyla,
    In this kind of situatins what i do is :
  1. i create a simple <form>
  2. include the <input type=hidden name=h>
    then assign value that you want to pass int to
this hidden variable. i.e.
   document.form1.h.value = userInput;
  3. post the form to that servlet
    document.form1.submit();

   this is my implementation

***
   the second implemention can be done is that you
directly put this <select></select> in <form> and
access the .value property of that pertuculer select
  i.e.
   <select name=s1>
     <option value=1>One
     <option value=2>Tow
   </select>
   then,
       formname.s1.value=1 when "One" is selecte.

-Prem.




--- "Suon, Thla" <[EMAIL PROTECTED]> wrote:
> a value from a JavaScript to a JavaServlet
> parameter?
>
> For example, I have:
>
>           rs = stmt.executeQuery("SELECT unique
> releaseno from
> scars.tc_releases where status='active'");
>
>           out.print("<td>");
>           out.print("<select name=release size=1
> onclick= Sel_Rel()>");
>           out.print("<option value= " +">" +"select
> a release");
>           while(rs.next()){
>           int a = 0;
>           int b = 0;
>           int c = 0;
>           int d = 0;
>              releaseno[a] =
> rs.getString("releaseno");
>              //sabbr[b] = rs.getString("sabbr");
>              //status[c] = rs.getString("status");
>              //pcabbr_release[d] =
> rs.getString("pcabbr");
>              out.print("<option value= "
> +releaseno[a]+">" +releaseno[a]);
>           }//end rs.next
>           out.print("</select>");
>           out.print("<script
> type=\"text/javascript\"
> language="JavaScrip\">");
>           out.print("function Sel_Rel(s) { ");
>           out.print("userInput = new String();");
>           out.print("userInput =
> s.options[s.selectedIndex].value;");
>           out.print("}");
>           out.print("</script>");
>
> Note that userInput will contain a selected value,
> but how do I pass this
> value to a servlet parameter to do
> something with userInput inside a servlet?  Any help
> is appreciated!!
> Thank you.
>
> Tyla
>
>
___________________________________________________________________________
> 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


__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.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

Reply via email to