Skip to main content

IMPORTANT - Product End of Life Statement - IMPORTANT

Request RE, Survey, and Calendar 1.5 Support Ending December 31, 2020
Contact Kinetic Data Support with Questions
Kinetic Community

Validation on Blur

Instructions on how to get Kinetic Request CE to check field validations on blur (leaving a field) as well as the standard submit validation.


It may be necessary or desired to check the validations of a field as soon as the user leaves the field in addition to the standard/ootb validation check at submission time. This is done by leveraging the K('field['+fieldName+']').validate() function and the jQuery blur function set up on the page load against the appropriate object (field).

Note that the below example leverages pattern, but .validate() returns all validation messages for failed validation in an array. They can each/all be displayed, or you can choose to only display the first. It is up to you.


In this example, we will be validating an IP address field, and using notifie library to display and error if the pattern of the field doesn't validate when the user leaves the field, as well as on submit time.

First, the field needs to be set up with the IP address pattern and an appropriate message.

Then the question is given the appropriate Render Attribute so there is a specific class on that field.

And lastly, an on load custom event is set up that validates the question on blur.

    var fieldName = $(this).attr('name');
    var errors = K('field['+fieldName+']').validate();
    if(errors.length > 0) {
      $(K('field['+fieldName+']').element()[0]).notifie({ type: 'alert', severity: 'danger', message: message, expire: 500, exitEvents: 'click'});