You'd need to employ both javascript and server-side code, as the username will need to be a database query . Given that, you might as well stick with server-side only, as javascript is so easy to circumvent. What server-side scripting language are you planning to employ?