Learn how to Make Money Online doing freelancing, Affiliate Marketing, Blogging and many more ...
Go4Expert
Go4Expert RSS Feed

Go Back   Programming and SEO Forum >  Go4Expert > Queries and Discussion > Web Development > JSP

Reply  Copy HTML to Clipboard  Copy BBCode to Clipboard  | More
 
Bookmarks Thread Tools Search this Thread Display Modes
Old 03-19-2010, 01:06 PM   #1
Newbie Member
 
Join Date: Mar 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
padmaharika is on a distinguished road

Passing an selected option to another jsp page


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.

Code:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<head>
<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');
}
}
</script>
</head>
<body>
<form name="myform"><div align="center">
STATE: <select name="optone" size="1"
onchange="setOptions(document.myform.optone.options[document.myform.optone.selectedIndex].value);">
<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>
</select>
<input type="button" name="go" value="Click"
onClick="window.open('profile.jsp','mywindow','width=500,height=350,toolbar=no,resizable=yes,menubar=yes')">
</div></form>
</body>
</html>
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 .
padmaharika is offline   Reply With Quote
Reply  Copy HTML to Clipboard  Copy BBCode to Clipboard  | More


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Bookmarks

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads / Articles
Thread Thread Starter Forum Replies Last Post
Master Pages in ASP.NET sanjitsil ASP / ASP.NET 2 06-19-2009 04:09 PM
Help with ezhomesite script winxclub.us Perl 1 03-27-2009 01:03 AM
Need help with pl script winxclub.us Perl 1 03-16-2007 06:54 AM

 

All times are GMT +5.5. The time now is 05:33 AM.