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:
    1. Y/N: Y is used for required and N is used for not required (Default value is 'N')
    2. Set Validation Functionality (Optional)

      T – Normal Validation

      A – Alphabetic Validation

      AN – Alphanumeric Validation

      N – Numeric Validation

      D – Date Validation

      E – Email Validation
    3. MINLength: Numeric value to define minimum length of the element value. (Optional)
    4. MAXLength: Numeric value to define maximum length of the element value. (Optional)
    5. 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