1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Passing an selected option to another jsp page

Discussion in 'JSP' started by padmaharika, Mar 19, 2010.

  1. padmaharika

    padmaharika New Member

    Mar 19, 2010
    Likes Received:
    Trophy Points:
    Hello sir

    I have created a dynamic dropdown box containing a list of states ,when i click a particular state it populates corresponding list of cities in another dropdown box.

    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    <script type="text/javascript">
    function setOptions(chosen) {
    var selbox = document.myform.opttwo;
    selbox.options.length = 0;
    if (chosen == " ") {
      selbox.options[selbox.options.length] = new Option('Please select one of the options
    above first',' ');
    if (chosen == "1") {
      selbox.options[selbox.options.length] = new Option('hyderabad','hyd');
      selbox.options[selbox.options.length] = new Option('Secunderabad','sec');
    <form name="myform"><div align="center">
    STATE: <select name="optone" size="1"
    <option value=" " selected="selected"> </option>
    <option value="1">Andhra Pradesh</option>
    <option value="2">Second Choice</option>
    <option value="3">Third Choice</option>
    </select><br /> <br />
    CITY: <select name="opttwo" size="1">
    <option value=" " selected="selected">Please select one of the options above first</option>
    <input type="button" name="go" value="Click"
    Till here it working perfectly ,but when i go to profile.jsp page i want to display the name of the State and city i have selected.So please can u help me in teling how to pass the parameters to drop down box to another page .

Share This Page