Thanks, it works!
I want to send username data entered in the Form to a script which will then check the database for username availability. I've trouble getting it work.
Here's what I did:
PHP Code:
var name = $("#name");
$.ajax({
url:"/cgi-bin/isaccount.cgi?name.val()",
async:false,
success:function(data){
if(data=="no"){
alert("name ok");
}
if(data=="yes") {
alert("Name In Use");
}
return true;
}
}
The intention is to send the value of name to the script, isaccount.cgi for it to check username availability. It does not work because the value of name.val() is not passed to the script isaccount.cgi.
I don't think removing the " " in the following line will work:
url:"/cgi-bin/isaccount.cgi?name.val()",
Kindly advise how to do it.
Thanks.