Active Server Pages

Moderators: None (Apply to moderate this forum)
Number of threads: 1763
Number of posts: 4498

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Form Validation Posted by nomi85 on 22 Jun 2002 at 9:54 PM
hi,
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.


Report
Re: Form Validation Posted by bagles1 on 23 Jun 2002 at 5:19 PM
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
%>

-Bagles1




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.