This topic is locked

Registration Page

11/8/2005 9:43:50 AM
ASPRunnerPro General questions
stanl author

How can I require certain fields on the reqistration page. I notice that if I only put in a user name without a password, it will accept and allow registation without a password. Can I require the user to put in say:
Username

password

firstname

lastname

etc.
Thanks

Sergey Kornilov admin 11/9/2005

Hi,
you can modify builded register.asp file to add your custom validation.

Open register.asp from the ASPRunner output folder and locate the following snippet:

if strMessage="" then

    strSQL="insert into " & AddWrappers(cLoginTable) & " (" & fields & ") values (" & values & ")"



Insert you validation just before it:

Here is the example:

if request("userinfo_password")="" then

  strMessage=strMessage & "Password can not be empty"

end if

if request("userinfo_firstname")="" then

  strMessage=strMessage & "
First Name can not be empty"

end if

if request("userinfo_lastname")="" then

  strMessage=strMessage & "
Last Name can not be empty"

end if