Setup form field validation - properties and methodsExample | Options | Description |
ValForm.ElementName = "ElementName" |
|
Set the name of the form element |
ValForm.ElementType = "text" |
|
Set the element type (used for client side JS) - text, textarea, radio, checkbox, select - There is also a number type. "number" changes the way the min and max work to greater than less than and also changes the behaviour of the required property to Number Required |
ValForm.Val_Required = TRUE |
|
Set Val_Required = true if mandatory |
ValForm.Alt_Required = "mobile,office" |
|
CSV alternative fields that can be used! |
ValForm.Msg_Required = "My custom message" |
|
Set Msg_Required if you want a custom message - This is optional (Although the default isn't very good) |
ValForm.Val_Email = TRUE |
|
Set Val_Email = TRUE to check for a valid email address |
ValForm.Msg_Email = "My custom message" |
optional |
Set Msg_Email if you want a custom message |
ValForm.Val_Min = 3 |
|
Set the minimum number of characters for a valid input |
ValForm.Msg_Min = "My custom message" |
optional |
Set Msg_Min if you want a custom message |
ValForm.Val_Max = 25 |
|
Set the maximum number of characters for a valid input |
ValForm.Msg_Max = "My custom message" |
optional |
Set Msg_Max if you want a custom message |
ValForm.Val_Regexp = "[a-zA-Z]" |
|
ValForm.Val_Regexp = "[a-zA-Z]" |
ValForm.Msg_Regexp = "My custom message" |
optional |
Set Msg_Max if you want a custom message |
ValForm.Val_Date = TRUE |
|
Only allow valid dates if set to true |
ValForm.Msg_Date = "My custom message" |
optional |
Set Msg_Date if you want a custom message |
valForm.bool_Validate |
|
You must call validate at the end of each element - This will return true (success) or false if the element fails the above criteria - Set this to a variable if you want to know if this element has failed. |