Here is what I did but still does not work :
<%
        String requestUri = request.getRequestURI();
        int indexOfqm = requestUri.indexOf('?');
        if (indexOfqm != -1)
                requestUri = requestUri.substring(0, indexOfqm);

        String category = request.getParameter("category");
%>

<%
if (category !=null)
{
  category = (String)request.getParameter("flag");
}
else //If category wasn't in the query string, set it to a default value.
{
  category = "All"; //Fill in the default value here. I just used an empty
string.
}
%>

<center>
<script language="JavaScript">
function gotoFunction() {
        self.location =
document.productGoto.productList.options[document.productGoto.productList.selectedIndex].value;
}

</script>
<table  width="90%" cellpadding="4">
<tr >
<td bgcolor="#eeeeff">
<FORM NAME="productGoto">
<FONT FACE="Arial,Helvetica" SIZE="-2">
Select By Category:
<SELECT NAME="productList" onChange="gotoFunction()" onBlur="return
options[0].selected = true">
<OPTION VALUE="">Select a Category
<OPTION VALUE="<%= requestUri %>?category=All ">All Categories
<OPTION VALUE="<%= requestUri %>?category=Computing ">Computing
<OPTION VALUE=" ">Competition
<OPTION VALUE=" ">Commerce
<OPTION VALUE=" "> Audit Firms
<OPTION VALUE=" ">Government
<OPTION VALUE=" ">Health
<OPTION VALUE=" ">Industry
<OPTION VALUE=" ">Investment Advisors
<OPTION VALUE=" ">Law Firms
<OPTION VALUE=" ">Mutual Fund Pages
<OPTION VALUE=" ">News/Views
<OPTION VALUE=" ">Reference
<OPTION VALUE=" ">Transportation
<OPTION VALUE=" ">Travel
<OPTION VALUE=" ">Web Research
<OPTION VALUE=" ">WebPage Technology

</SELECT>
</FORM>
</td>
<td width="100%">

</td>
</tr>
</table>
<% System.out.println(">>>>>>>>>>>>>>> category = " + category); %>


>From: "Agarwal, Shekhar (MED, TCS America)" <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
>     reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: off topic( javascrpt + jsp) ???Urgent Please
>Date: Tue, 3 Apr 2001 14:53:39 -0500
>
>hi
>u can use the method onSelect()=document.formname.submit();
>then using request.getParameter("fieldname"); in the same jsp to get the
>value back.
>regds
>shekhar
>SHEKHAR AGARWAL
>TATA CONSULTANCY SERVICES
>Email : [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>Tel:  268-548-2592 (work)
>        262-798-1052 (home)
>
>
>-----Original Message-----
>From: sufi malak [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, April 03, 2001 2:41 PM
>To: [EMAIL PROTECTED]
>Subject: off topic( javascrpt + jsp) ???Urgent Please
>
>
>How can I have when a user select from a drop down list a name in a jsp
>page, the same file get submited with variable selected .
>Thanks lot.
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com
>
>========================================================================
>===
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
>DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
>DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to