Any one got hints how to do this?
I got 3 drop down list initally all 3 contains 4 option A,B,C,D.
After selecting A from 1stdrop down list,the 2nd and 3rd drop down list are left with B,C,D.
After selecting C form 2nd drop down list,the 3rd drop down list is left with B and D.
Any help/hints would be appreciated.
Thanks

Recommended Answers

All 5 Replies

<script language="javascript"> 
 
function mul1() 
{ 
    String a = document.getElementById("one").value; 
   // document.getElementById("second").setAttribute("value",a);
<%    String sql22 = "Select * from test where two!='"+a+"'";
Statement stmt22=con.createStatement();
ResultSet rs22= stmt22.executeQuery(sql22);
out.print("<select name=\"two\" id=\"two\" onChange=\"mul2();\">");
while (rs22.next())
{
String qwe=rs22.getString("two");
out.print("<option value="+qwe+">"+qwe+"</option>");
}
out.print("</select>");
%>
} 
</script> 
<body> 
<%
String sql2 = "Select * from test";
Statement stmt2=con.createStatement();
ResultSet rs2= stmt2.executeQuery(sql2);
out.print("<select name=\"one\" id=\"one\" onChange=\"mul1();\">");
while (rs2.next())
{
String qwe=rs2.getString("two");
out.print("<option value="+qwe+">"+qwe+"</option>");
}
out.print("</select>");
%>

THis is what i have tried so far doesnt work

I would do something like

function onAclick()
{
var item=document.getElementById("A").value;
document.getelementById("B").remove(item);
document.getelementById("C").remove(item);
document.getelementById("D").remove(item);
}

And similar in other dropdowns
Diseirra

%@page import="java.util.*"%>
<%@page import="java.lang.*"%>
<%@page import="java.sql.*"%>
<%@page import="java.text.*"%>
<%@page import="java.util.Date"%>
<%@include file="DBConnect.jsp"%>
<%@page import="java.util.Date"%>
<html> 
<head> 
<title>Untitled Document</title>  
</head> 
<script language="javascript"> 
function mul() 
{ 
var B=document.getElementById("one").value;

document.getelementById("tree").remove(B);
//document.getelementById("C").remove(B);
//document.getelementById("D").remove(B);
} 
</script> 
<body> 
<%
	String sql2 = "Select * from test";
	Statement stmt2=con.createStatement();
	ResultSet rs2= stmt2.executeQuery(sql2);
	out.print("<select name=\"one\" id=\"one\" onChange=\"mul();\">");
	while (rs2.next())
	{
	String qwe=rs2.getString("two");
	out.print("<option value="+qwe+">"+qwe+"</option>");
	}
	out.print("</select>");

		String sql21 = "Select * from test";
		Statement stmt21=con.createStatement();
		ResultSet rs21= stmt21.executeQuery(sql21);
		out.print("<select name=\"one1\" id=\"tree\">");
		while (rs21.next())
		{
		String qwe=rs21.getString("two");
		out.print("<option value="+qwe+">"+qwe+"</option>");
		}
		out.print("</select>");
%>
</body> 
</html>

I get a error message that say Object doesnt support this property or method

i have this type of code like
User:<select>
<option>Faculty</option>
<option>Student</option>
</select>
now what i want when i am selected Faculty option then page will be redirect to Faculty.jsp page is it possible in jsp ...plz reply me ...

i have this type of code like
User:<select>
<option>Faculty</option>
<option>Student</option>
</select>
now what i want when i am selected Faculty option then page will be redirect to Faculty.jsp page is it possible in jsp ...plz reply me ...

Start a new thread and read about onclick events:

<select onchange="">
..
</select>

or

<select onclick="">
..
</select>

http://www.w3schools.com/default.asp

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.