Form Validation - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Form Validation

I am using a form validation in ASP. I made a simple html form in which i take input from user his name,password,confrim password and full name and while submitting i call an asp file in which i request all the feilds from the html form.
In this asp page i validate the username that it exists or not .Can i also validate that password and the confirm password is same or not.


  • bagles1bagles1 Posts: 54Member
    Yes this is easily done. However, I think you will find that it is much easier to validate all the information in JavaScript because it can be done before the form is posted. However, if you are only wanting to find out how to do it in ASP I just answered this questions a couple of questions down. The way I read your question was basically validating that the user has input something in the user name field and that the passwords equal each other. If this is the case then this simple script would work.

    if trim(request.form("username")) = "" then
    ' username was empty or not filled in
    end if
    if request.form("password") <> request.form("confirmpassword") then
    ' passwords did not match
    end if


Sign In or Register to comment.