Client Side Validation Sample
Client Validation Sample
Text size validation
Text size
Validates the provided text.
Eg: The value must have in a minimum 3 characters and a maximum of 8.
Numbers only validation
Numbers
Validates the provided numbers.
Eg: Only numbers are accepted.
Email validation
Email
Validates the provided email.
Used regex.:
^[A-Za-z0-9](([_\.\-]*[a-zA-Z0-9]*)*)@([A-Za-z0-9]+)(([_\.\-]*[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$"
URL validation
URL
Validates the provided URL.
Used regex.:
https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*)
Custom validation regex
Custom Regex
Validates using a custom regex.
Eg.:
?=(.*[0-9]))((?=.*[A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z]))^.{8,}$
Should have 1 lowercase letter, 1 uppercase letter, 1 number, and be at least 8 characters long
Custom validation function
Custom validation
Validates using a custom javascript function.
Eg.:
function TestValidation(source, arguments){
var value = $('#' + source.controltovalidate).val();
if(value == "test"){
source.errormessage = "You can't type test!";
arguments.IsValid = false;
}
}
Submit
Built with
OutSystems
Loading...
Click here to see your activities