Hello friends, maybe you will confuse about the subject that i wrote, i have problem with form validation, i've made validation for every fields, but everytime one of the field was invalid, the previous field that already filled was became blank. So how can i pretend to make the fields (except password field) that already filled can not blank when there was a invalid fill.
Here is the script that i made :
if sName = "" then
Response.Redirect("registration.asp?err=Please fill the name")
end if
if sPassword = "" then
Response.Redirect("registration.asp?err=please fill the password")
end if
if sPassword <> sConfirm then
Response.Redirect("registration.asp?err=password is not same")
end if
if sGender = "" then
Response.Redirect("registration.asp?err=please choose gender")
end if
if dtDate = "" then
Response.Redirect("registration.asp?err=Please fill birth of date")
end if
if not isDate(dtDate) then
Response.Redirect("registration.asp?err=Invalid Birth Of Date")
end if
if iLen = 0 then
bFieldIsOkay = false
Response.Redirect("registration.asp?err=Please fill email address")
elseif iLen < 7 then
bFieldIsOkay = false
Response.Redirect("registration.asp?err=Email address should be more than 7 characters")
else
for t = 1 to iLen
if instr(searchchar, LCase(mid(sEmail, t, 1))) <> 0 then
counter = counter + 1
end if
next
if counter <> 1 then
bFieldIsOkay = false
Response.Redirect("registration.asp?err=Invalid Email Address")
else
for iCtr = 1 to mypos - 1
sChar = mid(sEmail, iCtr, 1)
if not instr(sValid, sChar) <> 0 then
bFieldIsOkay = false
response.redirect("registration.asp?err=Invalid Email Address")
end if
next
end if
for iCtr2 = mypos + 1 to mypos2
sChar = mid(sEmail, iCtr2, 1)
if not instr(sValid, sChar) <> 0 then
bFieldIsOkay = false
response.redirect("registration.asp?err=Invalid Email Address")
end if
next
end if