I would create a hidden field in the html page, then pass the javascript
value to the hidden field value.  You can then recover that value very
easily with a servlet.


William J Ortiz
Information Analyst Associate
XGAF - Metered Supplies
Phone: (716) 427-6892
e-mail: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
e


-----Original Message-----
From: Suon, Thla [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 30, 2000 6:06 PM
To: [EMAIL PROTECTED]
Subject: [SERVLET-INTEREST] Does Anyone Knows How to Pass...


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

___________________________________________________________________________
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