Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!

abhay patil

Greenhorn
+ Follow
since Apr 26, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by abhay patil

Hi all
I am trying to access all the values of countries from the database.
Depending upon the value I have selected my second drop down list should get populated with all the states from the selected country.
Now depending upon my selection for the second drop down my third drop down should get populated with all the cities of that state.
So I am expecting something like this:
First drop down (Country Name from the database)

Second drop down (State name from the data base where country name = Selected by the user in the first drop down)

Third drop down (City name from the data base where country name = selected by the user in the first drop down && state name = selected by the user in the second drop down
13 years ago
JSP
Hi All
Can any one help me?
I am trying to select a value from the dynamic drop down and depending upon my selection[i.e. state name] I would like to display all the related cities in the second drop down.
Here is the code:




[BPSouther: Added code tags and fixed encoded chars]
[ August 20, 2007: Message edited by: Ben Souther ]
13 years ago
JSP
Hi can any one help me.
I am trying to select value for my first drop down from the data base[i.e dynamic drop down which will display all the country names]. Depending upon the value you have selected for the first drop down I would like to show all the related data in the second drop down[i.e. all the states for the selected country].
Here is the code:& lt%@page import="java.sql.*"%>
& lthtml>
& ltbody>
& lt% String state = request.getParameter("state"); out.println(state);%>
& ltform name="my" action="abhay.jsp" method="post">
Country Name:& ltselect value=state onchange="my.submit();">
& lt%
if(state==null)
{
Connection con = null;
Statement st = null;
ResultSet rs = null;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:abhay","root","root");
st = con.createStatement();
String sa="select cname from cname";
rs = st.executeQuery(sa);
while(rs.next())
{
String y = rs.getString("cname");
%>
& ltoption value="& lt%= y%>">& lt%= y%>& ltoption>
& lt%
}
}
catch(Exception e)
{
out.println(e);
}
}
else
{
state= request.getParameter("state");
out.println(state);
}
%>
& lt/select>
& lt/form>
& ltform name="m">
& lt%
String h = request.getParameter("state") ;
out.println(h);
%>
& lt/form>
& lt/html>
13 years ago
Hi can any one help me.
I am trying to select value for my first drop down from the data base[i.e dynamic drop down which will display all the country names]. Depending upon the value you have selected for the first drop down I would like to show all the related data in the second drop down[i.e. all the states for the selected country].
Here is the code:& lt%@page import="java.sql.*"%>
& lthtml>
& ltbody>
& lt% String state = request.getParameter("state"); out.println(state);%>
& ltform name="my" action="abhay.jsp" method="post">
Country Name:& ltselect value=state onchange="my.submit();">
& lt%
if(state==null)
{
Connection con = null;
Statement st = null;
ResultSet rs = null;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:abhay","root","root");
st = con.createStatement();
String sa="select cname from cname";
rs = st.executeQuery(sa);
while(rs.next())
{
String y = rs.getString("cname");
%>
& ltoption value="& lt%= y%>">& lt%= y%>& ltoption>
& lt%
}
}
catch(Exception e)
{
out.println(e);
}
}
else
{
state= request.getParameter("state");
out.println(state);
}
%>
& lt/select>
& lt/form>
& ltform name="m">
& lt%
String h = request.getParameter("state") ;
out.println(h);
%>
& lt/form>
& lt/html>
Which of the following are not a valid declarations?
A1 float f = 1;
A2 float f = 1.2f;
A3 float f = 1.2;
A4 float f = (float)1.2;
In this case float f =1 is a valid declaration. Can any one help me why this declaraion is a valid declaration.
13 years ago
public class Test7{
public Test7(){}
public Test7(Test7 ref){
this (ref,"Hai");
}
public Test7(Test7 ref,String str){
ref.Test7(str);
System.out.println("Hi");
}
public void Test7(String str){
System.out.println(str);
}
public static void main(String[] args){
Test7 t = new Test7();
Test7 t7 = new Test7(t);
}
}
13 years ago
Hi all,
I am in great need of industry based java projects[Medium level] so that i will get more knowledge about it
Thank you
Abhay
13 years ago
Hi all,
I am in great need of industry based java projects[Medium level] so that i will get more knowledge about it
Thank you
Abhay
13 years ago