How to check that a custom mask text imput is complete

dezi168 10 Apr, 2015
Answer
Hi,

I share with the community how to add validation to check that a custom mask is complete.

To set a custom mask please follow the FAQ : https://www.chronoengine.com/faqs/70-cfv5/5204-how-to-add-a-custom-mask-to-the-text-box.html

In the "Validation" tab of the text input that has a custom mask, add in the field "Custom function" the name of your custom function to test completion. For example : checkComplete.

In "setup", add a "Load javascript" action and place the following code in the "JS code" field :
function checkComplete(el) {
if($(el).inputmask("isComplete")){return true}else{return false}
}


Hope it will help people.

Best regards
dezi168 10 Apr, 2015
And if you want to add a custom message in case the input is incomplete just add the following code in the "load javascript" action :
jQuery.gvalidation.errors.custom= "My custom error message";
This topic is locked and no more replies can be posted.