Tornado API Library - V12.30.08

z.dbValidatorParams Property

Activate Validation and setup validation parameters.

Product Version

Gold
[VisualBasic]
PublicPropertydbValidatorParamsAsString
[C#]
publicstringdbValidatorParams{set;}

Property Value

Obj.dbValidatorParams = "(;,)CodeBase| EntryValidate| ValidColor| ValidMsg| InvalidColor| InvalidMsg| IncompleteColor| IncompleteMsg"

KeywordDescription
CodebaseVirtual location of the AspdbValidator.jar. This input is mandatory.
ValidateOnEntry Default=False. Validates the default values. Validator can validate a field upon a cursor or key to the input box or automatically validates upon form entry. When this parameter is set to "True", then the default value in the input box is checked whether you visit the box with the cursor/key or not. This action is very expensive and requires that the <Body Onload=IVInitStatuses()> is taken up by ASP-db. In fact when you click this box, this OnLoad will be appended to the <BODY ...> tag. However, using EditBodyTag (New keyword as BodyTag is for Grid & Form) in dbOptions will allow user body tags to be included. Without ValidateOnEntry, if the default values are invalid, then it 'll also be passed. As always, if cursor vist the box then content of the input box will already be validated. When validator is activated (dbValidatorParams<>"") then the EditValidateName of dbEditParams will have the value of "aspdbValidatorSubmit" and user will not be able to use this feature.
ValidColorColor of text when input value is valid. Def=Blue.
ValidMsgMessage text when valid. Def=OK.
InvalidColorColor of text when input value is invalid. Def=Red.
InvalidMsgMessage text when invalid. Def=Invalid Input.
IncompleteColorColor of text when input value is not complete but valid. Def=Magenta
IncompleteMsgMessage text when incomplete. Def=Incomplete Input.
UserValidateJsuse user javascript to perform validate intead of using Tornado's validate. See example code below.

QuickProp Keyword Abbreviation

vp

Remarks

The property prime functionis to activate the validation activity just be begin non-blank. The properties defined are really non-essential.

Example

<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Dim Update As New Tornado.Z()
   With Update
    .dbUnit = 701
    .dbMode = "ty=dual-horiz| sysind=t"
    .dbSkin = 3
    .dbDSN = "nwind.mdb"
    .dbSQL = "Select * From employees"
    .dbGridDisplayFlds = "0,1"
    .dbValidatorParams = "code=/tornado/Jars|entry=false"
'...if you are using Sun's VM then you need to use the appropriate applet
'... .dbCalendar = "Archive = /tornado/scratch/calendar_sun.jar"
    .dbEditUpdateFlds = "fi=0|ty=RONOUPdate,4,fi=HireDate|ty=TextCalendar," & _
      "fi=HomePhone|ty=TEXT|mask=USPHONE|event=both|req=true|err=Must be " & _
      "XXX-XXX-XXXX,fi=ReportsTo|ty=SELECTBOX|val=EID|tex=FullName,fi=Notes|" & _
      'type=TextArea|tag=COLS=25 ROWS=5"
    .dbNavigationItem = "top,bottom,prev,next,update"
    .dbBookMark = "employees;0"
    .dbFormMagicCell="fi=HireDate|macro=#Hiredate::d#"
    .dbCommonTables = "index=EID,First,FullName|sql=Select employeeid,Firstname," & _
      "Firstname & ' ' & Lastname from employees"
    .dbLookUpFlds = "fi=EmployeeID|key=EID|look=FullName,fi=ReportsTo|key=EID|look=Fullname"
    .dbTextHolder = "Title=Tornado Demo - Normal Update with Advanced Validation"
    .ASPdbNET()
   End With 
End Sub
</script>
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
  Dim ta As String = "<script language='javascript'>" & vbCrLf
        ta &= "function checkselect(thisform){" & vbCrLf
        ta &= "if (thisform.ASPDB_UPDATE_16_0.options[thisform['ASPDB_UPDATE_16_0'].selectedIndex].value == '')" & vbCrLf
        ta &= "{" & vbCrLf
        ta &= "alert('ReportsTo Field cannot be Blank');" & vbCrLf
        ta &= "return false;" & vbCrLf
        ta &= "}" & vbCrLf
        ta &= "else {return true;}" & vbCrLf
        ta &= "}</script>" & vbCrLf
        Dim Update As New Tornado.z
        With Update
            .dbUnit = 701
            .dbMode = "ty=dual-horiz| sysind=t"
            .dbSkin = 3
            .dbDSN = "nwind.mdb"
            .dbSQL = "Select * From employees"
            .dbGridDisplayFlds = "0,1"
            .dbValidatorParams = "code=/tornado/Jars|entry=false| UserValidateJs=checkselect(thisform)"
            .dbEditUpdateFlds = "fi=0|ty=RONOUPdate,4,fi=HireDate|ty=TextCalendar, " & _
            "fi=HomePhone|ty=TEXT|mask=USPHONE|event=both|req=true|err=Must be " & _
            "XXX-XXX-XXXX,fi=ReportsTo|ty=SELECTBOX+B|val=EID|tex=FullName,fi=Notes|" & _
            "type=TextArea|tag=COLS=25 ROWS=5"
            .dbNavigationItem = "top,bottom,prev,next,update"
            .dbBookMark = "employees;0"
            .dbFormMagicCell = "fi=HireDate|macro=#Hiredate::d#"
            .dbCommonTables = "index=EID,First,FullName|sql=Select employeeid,Firstname," & _
            "Firstname & ' ' & Lastname from employees"
            .dbLookUpFlds = "fi=EmployeeID|key=EID|look=FullName,fi=ReportsTo| key=EID|look=Fullname"
            .dbTextHolder = "Title=Tornado Demo - Normal Update with Advanced Validation"
            .dbSendHead = ta
            .ASPdbNET()
        End With
End Sub      
</script>
 

See Also

z Class | Tornado Namespace | Special Topic - Validation