Hi!
I have add a address field in the Web Wiz registration process. I use the function checkform to check for an address. That was not so hard to do and it works fine.
//Check for a adress if (formArea.GatuAdress.value.length < 5){ errorMsg += "\n\t<% = strTxtErrorGatuAdress %>"; } |
I have field with birth date I want to include. The birth date is special in Sweden because we have also a personal security number to se if its realy you.
My own registration cod is diffrent from web wiz so Im not shure how to include
an function in to the checkform or if I should. Im not shure how to solv
this so any help would be nice.
The funktion looklike this and checks year, day, month and securitycode of 4 number. If its a real personal number.
Function CheckNumber(ByVal strNumber) ' deklarera variabler Dim lngSum, lngTemp, lngPos
' kontrollera formatet With New RegExp .Pattern = "^\d{2}-?\d{2}-?\d{2}-?\d{4}$" If not .Test(strNumber) Then CheckNumber = False Exit function End If End With
' ta bort eventuella bindestreck strNumber = Replace(strNumber,"-","")
' beräkna checksumman lngSum = 0 For lngPos = 1 to 10 lngTemp = CLng(Mid(strNumber, lngPos, 1)) * ((lngPos mod 2) + 1) If lngTemp > 9 Then lngTemp = lngTemp - 9 lngSum = lngSum + lngTemp Next
' kontrollera checksumman CheckNumber = (lngSum mod 10) = 0 End Function
|
EDITMy ide is something like this
//Check for a personalnumber If NOT (CheckNumber(formArea.PersNummer)) { errorMsg += "\n\t<% = strTxtErrorPersNummer %>"; } |
Edited by SkIpErMan - 26 April 2009 at 11:05am