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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

validate on Focus ejMaskEdit

Thread ID:

Created:

Updated:

Platform:

Replies:

125654 Aug 31,2016 11:26 AM UTC Sep 1,2016 01:23 PM UTC JavaScript 1
loading
Tags: ejMaskEdit
bdu
Asked On August 31, 2016 11:26 AM UTC

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

Karthik Ravichandran [Syncfusion]
Replied On 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

 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;