i have two dropdown menus ..upon selecting item from one listbox,items in second listbox shoud change accordingly..
i tried with javascript function event..onChange...but could not able to pass the parameter to querystring..getting error like..Object does not support this property/method..
here goes my code...
<html>
<head>
<title>User page</title>
<script language="JavaScript">
function Selec()
{
var some = (document.user.company.options[document.user.company.selectedIndex].value);
alert(some)
document.user.action = ("UserProcess.jsp?whatstr="+some+"");
document.user.submit();
}
</script>
</head>
<body bgcolor="#123456" text="silver">
<form name ="user" method="post" action="UserProcess.jsp">
<br><br>
<center><h2>User Details</h2></center>
<center><table border="3" bgcolor="gray" bordercolor="silver">
<tr><td>Userid:</td><td><input type ="text" name ="uid"></td></tr>
<tr><td>Password:</td><td><input type ="password" name ="pwd"></td></tr>
<tr><td>Role</td><td><input type ="text" name ="role"></td></tr>
<tr><td>First Name:</td><td><input type ="text" name ="fname"></td></tr>
<tr><td>Last Name:</td><td><input type ="text" name ="lname"></td></tr>
<tr><td>E-Mail:</td><td><input type ="text" name ="email"></td></tr>
<tr><td> Company</td><td> <select name="company" onChange="Selec()">
<%@ page errorPage = "errorpage.jsp" %>
<%@ page language="java" import="java.sql.*" %>
<%!
Connection con = null;
Statement st = null;
ResultSet rs = null ;
String param = null;
%>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc

dbc:rannhill","","");
st = con.createStatement();
// database parameters
// generate query
String Query = "SELECT DISTINCT companygroup FROM projects_table";
// get result
rs = st.executeQuery(Query);
// get and display each record
while(rs.next())
{
String comp = rs.getString("companygroup");
%>
<option value= '<%= comp %>'> <%= comp %>
<%
}
// close connections
rs.close();
st.close();
con.close();
%>
</select>
</td>
</tr>
<tr>
<td><b> Project </b></td>
<td>
n <select name="project">
<%
Connection con1 = null;
Statement st1 = null;
ResultSet rs1 = null ;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con1 = DriverManager.getConnection("jdbc

dbc:rannhill","","");
st1 = con1.createStatement();
// database parameters
// generate query
param = request.getParameter("whatstr");
System.out.println("this is parameterfrom js function.."+param);
String Query1 = "SELECT DISTINCT title FROM projects_table where companygroup='"+param+"'";
// get result
rs1 = st1.executeQuery(Query1);
System.out.println("after query of projects");
System.out.println(rs1);
// get and display each record
while(rs1.next())
{
String proj = rs1.getString("title");
out.println("<option>" + proj);
}
// close connections
rs1.close();
st1.close();
con1.close();
%>
</select>
</td></tr>
</table>
<br><br>
<center><table width ="200" border="2"><tr>
<td><input type ="submit" value = "Add" name = "action"></td>
<td><input type ="submit" value = "ShowAll" name="action"></td>
<td><input type ="submit" value = "Edit" name="action"></td>
<td><input type ="submit" value= "Delete" name="action"></td>
<td><input type = "Reset" value="Clear"></td></tr></table></center>
</form>
</body>
</html>