Hi Try This Script
Use it For U'r data types
Make necessary changes where u want.
<HTML>
<HEAD><TITLE>RYGStatus</TITLE>
<Script language="JavaScript">
function assignID() {
var id =document.frmStatus.lstPrograms.selectedIndex;
var prog_ID =document.frmStatus.lstPrograms.options[id].value;
document.frmStatus.method="post";
document.frmStatus.action='new.jsp?progID=' +prog_ID;
document.frmStatus.submit();
}
</script>
</HEAD>
<BODY>
<FORM name="frmStatus" TARGET="Content">
<%! String v_progId; %>
<% v_progId = request.getParameter("progID");%>
<% out.println(v_progId);%>
<!-- CALLING THE FUNCTION assignID() on onCHANGE event-->
<Select name="lstPrograms" onChange="assignID();">
<option value=1>one
<option value=2>Two
<option value=3>Three
</option>
</select>
</form>
</body>
</html>
nilesh
Geeta Kottapalli <[EMAIL PROTECTED]> on 06/13/2000 02:46:17 AM
Please respond to A mailing list about Java Server Pages specification and
reference <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc: (bcc: nil/aplnmum01/SHCIL/IN)
Subject: Re: JSP - JavaScript Question ??...URGENT!!
I am using NN 4.7 as browser.
Fisrt I used JWS with default jdk1.1.7 where it could
not complie most of pages and
then I used JWS with jdk1.2.2 and now the pages work
fine except for the javascript.
In most of my pages I need to send only one parameter
so I could manage by creating
a hidden field and naming that with the required
parameter name and it is working fine.
But in two pages I need to send the query string where
I am getting struck and
really have to solve this.
You suggested me to use <form action="..."
method="post"> but I cannot use that
because when option is changed in a listbox it has to
submit the page to itself
and when submit button is pressed it should submit to
a different page.
Geeta
--- Attili Srinivas <[EMAIL PROTECTED]>
wrote:
> Hi,
> Can you tell me what browser and version u r
> using...
> try to put everything in the <form> tag like
> method,target and action
> Sri
>
>
>
>
>
> "Geeta Kottapalli" <[EMAIL PROTECTED]> on
> 06/12/2000 02:43:49 PM
>
> Please respond to "A mailing list about Java Server
> Pages specification and
> reference" <[EMAIL PROTECTED]>
>
>
>
> To: [EMAIL PROTECTED]
>
> cc: (bcc: SRI N. ATTILI/EMPL/MD/Bell-Atl)
>
>
>
> Subject: Re: JSP - JavaScript Question
> ??...URGENT!!
>
>
>
>
>
>
> --- Geeta Kottapalli <[EMAIL PROTECTED]> wrote:
> > Thanks for the quick responses!!
> >
> > Sorry for the typos in the code.
> > I did atually use document.frm.submit();
> > and I used the same case for requested parameters.
> >
> > Srinivas, I tried the way you suggested but did
> not
> > work.
> >
> > The sample code is as follows.When selection is
> > changed in the listbox, appropriate info must be
> > displyed
> >
> > <%@ page language="java"%>
> >
> > <jsp:useBean id="db" scope="request"
> > class="oatsapp.GeneralOats" />
> > <jsp:setProperty name="db" property="*" />
> >
> > <HTML>
> > <HEAD><TITLE>RYGStatus</TITLE>
> >
> > <Script language="JavaScript">
> >
> > function assignID() {
> >
> > var id =
> > document.frmStatus.lstPrograms.selectedIndex;
> > var prog_ID =
> > document.frmStatus.lstPrograms.options[id].value;
> >
> > document.frmStatus.method="post";
> > //var
> >
>
path="http://localhost:8080/oatsapp/Status.jsp?progID="
> > + prog_ID;
> >
> document.frmStatus.action='Status.jsp?progID='
> > +
> > prog_ID;
> > document.frmStatus.submit();
> > }
> > </script>
> > </HEAD>
> >
> > <BODY>
> > <FORM name="frmStatus" TARGET="Content">
> >
> > <%! String prog_ID =
> request.getParameter("progID");
> > %>
> > <% if !(prog_ID == null) {
> int v_progId = Integer.parseInt(prog_ID);
> }
> %>
> > <!-- CALLING THE FUNCTION assignID() on onCHANGE
> > event
> > -->
> >
> > <Select name="lstPrograms" onChange="assignID();">
> >
> > <% String program[][] = db.getProgramsList();
> > for (int i=0; i<program.length; i++ ) { %>
> >
> > <option value="<%=program[i][0]%>"
> > <%=(Integer.parseInt(program[i][0]) ==
> > v_progId ? "SELECTED>": ">")%>
> > <%=program[i][1]%>
> > </option>
> > <% } %>
> >
> > </select>
> > </body>
> > </html>
> >
> >
> >
> > If any one knows the solution please let me know!!
> >
> > Thanks,
> > Geeta
> >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Photos -- now, 100 FREE prints!
> > http://photos.yahoo.com
> >
> >
>
===========================================================================
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> > body: "signoff JSP-INTEREST".
> > 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
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos -- now, 100 FREE prints!
> http://photos.yahoo.com
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> 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".
> 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
__________________________________________________
Do You Yahoo!?
Yahoo! Photos -- now, 100 FREE prints!
http://photos.yahoo.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
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".
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