Never try to be a hard-worker. Be a smart-worker.
My Blog
SCJP 1.4 & 1.5, SCWCD 1.5. Learn and Let Learn.
Never try to be a hard-worker. Be a smart-worker.
My Blog
Like if i select "username" from combobox, then textfield1,2,3 are filled with user password, user address,and user email.Like this way..
SCJP, SCWCD.
|Asking Good Questions|
No, you don't. there is no such thing as a "combo box" in HTML. Please read this for more information.Originally posted by Rajkumar balakrishnan:
I have a page that has a combo box.
No, you can't. That's what the Ajax is for. JavaScript has no means to call Java methods on the server.Originally posted by Carlos Herrera:
On YourJavaScriptFunction you can call a method from your Java class ...
Never try to be a hard-worker. Be a smart-worker.
My Blog
No, that still won't work.Originally posted by Carlos Herrera:
I think I expressed myself in a bad way. You call the Java class inside your JavaScript function, but also, inside the JSP tags. Actually, I believe you're calling your method Java through Java.
Something like this:
What has your debugging steps revealed?Originally posted by Rajkumar balakrishnan:
I just do the coding but when i select the values it seems to be idle. No changes have been there in my form.
Have you used Firebug in Firefox to see if your Ajax request is being sent
correctly and returning the expected response?
XMLHttpRequest Status=0 readyState=0 multipart=false
Never try to be a hard-worker. Be a smart-worker.
My Blog
var xmlHttp
function showCustomer(str)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert("Your browser does not support AJAX!");
return;
}
var url="getvendor.jsp";
url=url+"?q="+str;
//url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged()
{
if (xmlHttp.readyState==4)
{
document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
<!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>Get Vendor</title>
</head>
<body>
</body>
</html>
Never try to be a hard-worker. Be a smart-worker.
My Blog
Error: java.sql.SQLException: null, message from server: "Unknown column 'q' in
'where clause'"
Never try to be a hard-worker. Be a smart-worker.
My Blog
Why would this be moved to the JSP forum when the problem is clearly in your JDBC?Originally posted by Rajkumar balakrishnan:
Will i move this query to JSP page..!!!
Never try to be a hard-worker. Be a smart-worker.
My Blog
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |