View Full Version : form, check if username exist

06-27-2007, 06:14 PM
Hello, I just started learning javascript and I need to use it on my register form. At the moment it will open an alert window if I write a username less then 6 letter and more then 10 but I would like to check if the username exist before you submit the form but Im not sure how to select the query and the use it in java.

Is there a way I can check if the person wrote thing I dont wont such as !"#¤%&/() and so on..

06-27-2007, 06:19 PM
You would need to use AJAX and a server side script to check if the username exists in the database already.

06-27-2007, 06:30 PM
bah, oh well I think I skip that then. At the moment I send the user back if its exist.

Anyways is there a way to check if the user use letter and shuch that I dont want?

06-27-2007, 06:39 PM
You could look into using Regular Expressions. Good to use for things like this.
Hope this helps.

06-27-2007, 06:58 PM
But again, because Javascript can be bypassed, you need to do server-side checking too.