Hallo
ASP Server validation:
many times I have the necessity to compare two value, one in the textbox and another one in the db; if the values are the same the answer must be a error...
I haven't find of better who...
1) apply the command "Like Entry" whit a little modify:
if not recordset1.EOF or Not recordset1.BOF then
mailx=(recordset1.Fields.Item("mail").Value)
else
mailx="xyz@xyz.com" ' to bypass empty value
end if
WAFV_Errors = WAFV_Errors & WAValidateNOLE(cStr(Request.Form("email")) & "", mailx & "",true,2)
2) modify the code in WAVT_Scripts_VB.asp and add this function:
function WAValidateNOLE(value1,value2,required,number)
dim WAFV_ErrorMessage, isValid
WAFV_ErrorMessage = ""
isValid = true
if (value1 = value2 OR (required AND value1 = "")) then
isValid = false
end if
if (NOT isValid) then
WAFV_ErrorMessage = WAFV_ErrorMessage & "," & number
end if
WAValidateNOLE = WAFV_ErrorMessage
end function
Exist another method? If no, is possible to add this function (unLike Entry) at the next update?
Thank you
Regards
Luca