I am new here and I wonder if I am in the right spot.
I am trying to make a script using php and javascript to where every letter entered in my text box it will run through the database and check wheter or not the username is already registered. If it is already registered it shows an x and if not it shows a check.
I have removed some stuff that I have tried and failed. My main goal is getting javascript to run through and check the database.
I know that I need to connect to the database.
My code is this:
http://s199039163.onlinehome.us/user.php
<SCRIPT LANGUAGE="JavaScript">
function display()
{
document.getElementById("available").innerHTML = window.form.text.value;
}
function checkForm()
{
var theMessage = "You have errors in the following fields: \n------------------------------------------\n\n";
var noErrors = theMessage
if ( document.form.text.value == "" )
{
theMessage = theMessage + " Username";
document.form.text.focus();
}
if ( theMessage == noErrors )
{
return true;
}
else
{
alert(theMessage);
return false;
}
}
</script>
<form name="form" onSubmit="return checkForm( this );">
<input type="text" name="text" maxlength="16" onKeyUp="display()"> <font id="available"></font>
<br />
<input name="submit" type="submit" value="submit">
</form>
Sincerely,
Jordan Martin
Seraskier