Hi guys, I need help on my script, im using ajax on my signup form and an alert message pop up when theres an empty fields. How can i check my database if the username entered already exist in the database using javascipt and an alert message will pop up when username already exist? is it possible to to use php inside javascipt to check the database if the username already exist. im an ajax newbie. Pls help me think of any solution with this problem. Thanks in advance.
Here's an example using a SELECT query. You can modify it to return, say, a 1 or a 0, if the user name already exists, or doesn't. You can use the onblur event for the userName text field to call the AJAX function, when the user tabs away from the field: <input type="text" name="userName" onblur="update(this.value)"> http://ajaxforums.net/index.php?topic=858.0