We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

validate on Focus ejMaskEdit

Hello
 I use a ejMaskEdit. I would like to make a validation using jQuery validation but on the outfocus ejMaskEdit. And not on a button click in a form.
There are examples with grids.
Could you give me an example to better understand the syntax.
Thank you

<Script type = "text / javascript">

.validator.setDefaults $ ({
ignore []
focusOut: function (element) {
$ (Element) .Valid ();
},
errorClass: e-validation-error '
errorPlacement: function (error, element) {
$ (Error) .insertAfter (element.closest () "e-widget.");
}
});

$ ( "# MaskEdit"). EjMaskEdit ({
name: "mask"
inputMode: ej.InputMode.Text,
ValidationRules: {
required: true

},
ValidationMessage: {
required: "Required value"
},
width: "120px"
// MaskFormat "9.9.9.9",
}); // MaskEdit

</ Script>
Google Traduction pour les entreprises :Google Kit du traducteurGadget Traduction

1 Reply

KR Karthik Ravichandran Syncfusion Team September 1, 2016 01:23 PM UTC

Hi Bertrand,

Thanks for contacting Syncfusion support,
 
 
We have analysed your query. We would like to inform you that, the validation occurs on every keyup events in jQuery. It is the default functionality of jQuery validation. We can add the validation for MaskEdit control, please refer the below code snippet 
$("#maskedit").ejMaskEdit({ 
    validationRules: { required: true }, 
    validationMessage: { required: "Required value" }, 
    inputMode: ej.InputMode.Text, 
    value: "4242422424", 
    maskFormat: "99 999-99999", 
    width: "100%" 
}); 
 
For your convenience we have prepared the sample and it can be available in below link

http://jsplayground.syncfusion.com/wg45yvyi
 
 
Please let us know if you have any concerns 
 
Regards 
Karthik R

 


Loader.
Up arrow icon