Webform JS Validation
Categories
Component ID
2336137
Component name
Webform JS Validation
Component type
module
Maintenance status
Development status
Component security advisory coverage
not-covered
Component created
Component changed
Component body
Client side validation of the whole website is now in one go. It supports all the browsers like IE, Firefox, Chrome, Safari etc.
Dependency: Webform, JQuery, jQuery Validation Plugin
How to use it?
- To validate any element of the form, use “alt†attribute.
For example,
<input type=â€text†name=â€firstname†alt=â€Y,A,MINLength,MAXLength,CustomMsg†title=â€First Name†/>Definiation of all comma seperated values is as below:- Y/N: Y is used for required and N is used for not required (Default value is 'N')
- Set Validation Functionality (Optional)
T – Normal Validation
A – Alphabetic Validation
AN – Alphanumeric Validation
N – Numeric Validation
D – Date Validation
E – Email Validation - MINLength: Numeric value to define minimum length of the element value. (Optional)
- MAXLength: Numeric value to define maximum length of the element value. (Optional)
- CustomMsg (Optional)
Webscript's default message format is “Please Enter [TITLE/NAME attribute of form element]â€
To override this default message, CustomMsg is used.
In webform component, Alt and Title fileds are added. Follow above steps and insert data in Alt and Title fields respectively as per your requirement.
You can also modify validation javascript in webform js validation module. The javascript file name is webonlinescripts.js
Click to View Demo
