•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 456,467 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,768 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 5873 | Replies: 2
![]() |
•
•
Join Date: Aug 2007
Posts: 40
Reputation:
Rep Power: 2
Solved Threads: 0
any suggestions...my "weatherState" value doesnt seem to be passing over:
1st jsp:
2nd jsp:
1st jsp:
<%
Vector theStates = WeatherDAO.getWeatherStates();
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</script>
<body>
<TR bgColor="#ffffff"><TD COLSPAN="2">
<TABLE CELLPADDING="3" CELLSPACING="2">
<TR><TD>
</FONT></CENTER><BR>
<BR>
<TABLE BORDER="0" CELLSPACING="5" CELLPADDING="5" WIDTH="100%">
<TR BGCOLOR="#C0C0C0" ><TD COLSPAN="2" ALIGN="CENTER"> <FONT SIZE=+3><B> Weather Services</B></FONT>
</TD></TR>
</TABLE>
<HR SIZE="3" NOSHADE>
<font size=+1>Choose a state and press continue</font><br>
<TR><TD>
<center>
<form name="form1" method="POST" action="/JAABA/jsp/cpanel/cp-weatherFive.jsp">
<label for="weatherState">State:</label>
<select name="weatherState" >
<% for (int i=0; i< theStates.size(); i++) { %>
<OPTION VALUE><%=theStates.elementAt(i)%></OPTION>
<%
}
%>
2nd jsp:
<%
System.out.println("error...: "+request.getParameter("weatherState"));
String sValue = request.getParameter("weatherState");
Vector theCities = WeatherDAO.getWeatherCities(sValue);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<body>
<TR bgColor="#ffffff"><TD COLSPAN="2">
<TABLE CELLPADDING="3" CELLSPACING="2">
<TR><TD>
</FONT></CENTER><BR>
<BR>
<TABLE BORDER="0" CELLSPACING="5" CELLPADDING="5" WIDTH="100%">
<TR BGCOLOR="#C0C0C0" ><TD COLSPAN="2" ALIGN="CENTER"> <FONT SIZE=+3><B> Weather Services</B></FONT>
</TD></TR>
</TABLE>
<HR SIZE="3" NOSHADE>
<font size=+1>Select the State and City for which you would like to receive weather information.</font><br>
<TR><TD>
<center>
<label for="weatherCity">City:</label>
<select name="weatherCity" >
<% for (int i=0; i< theCities.size(); i++) { %>
<OPTION VALUE=<%=theCities%>> <%=theCities.elementAt(i)%> </OPTION>
<%
}
%>•
•
Join Date: Apr 2006
Location: Mumbai, India
Posts: 351
Reputation:
Rep Power: 0
Solved Threads: 5
•
•
•
•
<select name="weatherState" >
It could probably be because you need to specify id for the select element. Some browsers pass data based on id, others based on the name attribute. To be safe, it is a good practice to define the id and the name.
<select id="weatherState" name="weatherState" >
![]() |
•
•
•
•
•
•
•
•
DaniWeb JSP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- day in a calender (JSP)
- Calling if() again in JSP (JSP)
- Replacement of goto???? (JSP)
- new to javascript (JSP)
- Unsure how to save to database dynamic Textfield values (JSP)
- Request.getParameter() (Java)
- getting error (JSP)
- change statement (JSP)
Other Threads in the JSP Forum
- Previous Thread: can anybody guide me
- Next Thread: Another MySQL issue...


Linear Mode