Form validation

Discussion in 'General Web Coding' started by zaboss, Oct 12, 2009.

  1. zaboss

    zaboss Perch

    Hi,

    I need a javascript snipet to check if the value entered in a field of a form match a value from a list. To be more specific, I need to check if the username is already taken before the user submit the form.

    Thanks,
  2. hafa

    hafa Perch

    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?
  3. zaboss

    zaboss Perch

    Thanks, I knew I would have to retrieve it from the database (via classic ASP).
  4. hafa

    hafa Perch

    You'd have to use Ajax to accomplish a call without hitting submit. While I don't have any ready-made code for you, there's a decent Ajax tutorial that you might find useful here.
  5. zaboss

    zaboss Perch

    The problem is that i'm completely clueless on javascript. I can aproximate the asp code needed, but can't do the javascript magic.

Share This Page

JodoHost - 26,000 hosting end-users in 100 countries
Plesk Web Hosting
VPS Hosting
H-Sphere Web Hosting
Other Services