Auto - Check Username
How would I go about auto checking the username a user enters on an HTML form? It is for a project I'm working on and need it finished. I do not currently have any code I'm working with now, haven't found anything useful o开发者_开发知识库n this.
You have to construct your validation routine first before you can do anything. I imagine it would take in a string and returns a boolean depending on if it finds the given string in the table of usernames.
Next, you have to attach a javascript event to fire off on keypress when the field is in focus. This Javascript event would pass the string in the field to the validation check. Then, you have to catch the reply and then react accordingly (display a success/error div or whatnot.)
I can try and churn out code if you want but the only PHP I know is using Codeigniter and the only Javascript I know is using JQuery so any code I will put out would be using those frameworks.
精彩评论