Hi,

    You can pass to HTML the category code as the VALUE of the
RADIO BUTTON .
In the servlet A:
out.println("<input type=\"radio\" name="category_code\" selected
value="000001"> This is category 1");
out.println("<input type=\"radio\" name="category_code\" value="000002">
This is category 2");
....
out.println("<input type=\"radio\" name="category_code\" value="XXXXXXX">
This is category XXXXXXXX");
....

Now in the servlet B:

String category_code=req.getParameterValues("category_code")[0];
String query="select product_name from product_master where
category_code="+category_code;
file://execute the query etc.


Best wishes,

                Andras.












----- Original Message -----
From: manoj kumar <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 16, 1999 1:30 PM
Subject: Re: passing valuees from javascript to servlets


> Hi Andras/Pradeep,
>
> Thanks for the help.
> My problem is a little bit more complicated.
> I am able to pass values from a HTML element to a Servlet.
> My problem is that based on that value I want to fire a query on a table.
> Let me further expalin the problem.
> Upon clicking a HTML link(or button), a servlet is called(A), which fires
a
> select query on a table
>
> select category_description from category_master
>
> The result of this query is formatted into an html page and sent back
> to browser.Now the user selects a particular category and presses
> submit/next(whatever).This results in a call to another servlet(B) or
> the same servlet(A,how..?) which in turn fires another query
>
> select product_name from product_master where category_code=xxxxxx
> This 'xxxxxxx' is something which should correspond to the category
selected
> by the user in the previously generated html page(by servlet A).
> I was thinking of making it possible through javascript but couldn't find
a
> solution.
>
> hope this clears the idea.
>
> help is immidiately needed.
>
> thanks
>
>
> manoj

___________________________________________________________________________
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