0

I was atteched two file with this poll, I m facing problem when <select> attrib value fetching.
email.txt Originally file(email.jsp),where i was connection with database & taking E-mail Field in to <select> dynamically,But when i redirect to otherpage this <select> attrib that time (request.getAttri(...))// Is taking Null value...
I can't fetch previous page selected combobox value, if Any one having idea about how to get comboBox value in redirected page..pls let me know urgent...
reply me on :[removed]

Edited by Ezzaral: Snipped email. Please keep it on site.

Attachments
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

	<title>jQuery Tools standalone demo</title> 
<link rel="stylesheet" type="text/css" href="../general_bgs.CSS"/>	
	<style> 
	
/* tab pane styling */

 
	</style> 
</head> 
 
<body> 

<form method="post" action="search_user.jsp"> 



<%! String filter_by_category="",j,i;%>
<%@ page import="java.sql.*" %>
<%	
	try {
	Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
	Connection con=DriverManager.getConnection("jdbc:odbc:GJ","","");
	out.println("connection established");
	String s1 ="select EMAIL  from FEEDBACK_DATA";
	Statement stmt = con.createStatement();
	ResultSet rs=stmt.executeQuery(s1);



%>	<select name="e_mail" id="e_mail"><%
	while(rs.next())
		{
		i=rs.getString("EMAIL");
		%>
	    <option><%=j%></option>
		<%
	//	i=rs.getString("EMAIL");
	//	out.println(i);
   		}
	}//tryover
	catch (Exception ignored)
 	{}
%></select>
 


<select class="listmenu" name="budget" id="budget">
        <option>Select Estimated Budget</option>
        <option>$0 - $ 10,000</option>
        <option>$10,000 - $ 50,000</option>
        <option>$50,000 - $ 100,000</option>
        <option>$100,000 - $ 300,000</option>
        <option>$300,000 - $ 500,000</option>
        <option>$ 50,0000</option>
      </select>
<input type="submit" name="submit" value="SUBMIT INFO" >

</form>
 
 
</body> 
 
</html>
<%@ page language="java" %>
<%@ page import="javax.servlet.*" %>
<%@ page import="javax.servlet.http.*" %>
<%@ page import="java.sql.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
</HEAD>

<BODY>


<%!String a="",b="",c="",d="",e=""; %>

<%
	
	String E_MAIL=(String)request.getAttribute("budget1");
	String name=(String)request.getParameter("budget");
	out.println(name);
	out.println("The Value Is:"+E_MAIL);

	
	try {
	Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
	Connection con=DriverManager.getConnection("jdbc:odbc:GJ","","");
	
	out.println("connection established");
	String s1 ="SELECT CUST_NAME,EMAIL,COUNTRY,PROJECT_TYPE,CASH,FILE_NAME  from FEEDBACK_DATA where EMAIL='"+E_MAIL+"'";
	
	//'"+E_MAIL+"'
	Statement stmt = con.createStatement();
	ResultSet rs1=stmt.executeQuery(s1);
	
	
		while(rs1.next())
		{
		a= rs1.getString("CUST_NAME");
		b=rs1.getString("COUNTRY");
		c=rs1.getString("PROJECT_TYPE");
		d=rs1.getString("CASH");
		e=rs1.getString("FILE_NAME");
		
		
		}
	
	} //Try Block over
		catch(Exception e1)
		{
		}
		
		
%>



<form method="post" action="WEL.jsp">
<!-- This is for the Administrator Which is Update status for Customer project -->
CONTACT_NUMBER:<input type="text" name="text6" value="" />
<br>
REMAINING PAYMENT:<input type="text" name="text7" value=""/>
<br>
PROJECT STATUS:<input type="text" name="text8" value=""/>
<br><input type="submit" name="text8" value="UPDATE"/>
</form>


</center>
</BODY>
</HTML>
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by gyannitin
0

Hi Gautam,

I checked your email.txt file. You want the email ids to be populated in the drop down box. Easy way is to use LIST command. But this is also fine. You need to do some correction.

%>
	<select name="e_mail" id="e_mail"><%
	while(rs.next())
	{
	    i=rs.getString(1);
%>
        <option value="<%=i %>" ><%=i%></option>
<%
}
}
catch (Exception ignored)
 	{}
%>

make some changes in the search user.txt also.

String E_MAIL = request.getParameter("e_mail");
String name = request.getParameter("budget");

Moreover, at the end of resultset, a,b,c,d,e will have the value for the last record only.

Let me know if it solves your issue
:)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.