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

Control Error Class

Hello, I have the following
HTML:
<input id="fechaInicio" class="form-control" data-bind="ejDatePicker: { value: fechaInicio, enableStrictMode: true, locale: 'es-EC', buttonText: 'Hoy', select: onSelectedInicio }"/>
JS;
self.fechaInicio = ko.observable(moment().format('DD/MM/YYYY')).extend({ validatable: true });

Inspection the HTML code once i put focus on the ejDatePicker and it lose the focus the control adds <span class="e-datewidget e-widget e-error" aria-invalid="true"> showing error but i'm selecting the date from the selector and there is no error.

It's there a way to disable this, since i'm handilng errors with bootstrap and ko validation so i do not want that the ejDatePicker add error class to himself. 
And on the other hand if i can't disable wich is the error since it's a correct date selected.



5 Replies

HP Harikrishnan P Syncfusion Team July 13, 2015 12:41 PM UTC

Hi Hostilio,

Sorry about the inconvenience caused.

If “enableStrictMode” property is set to true, then DatePicker validates the date and adds an error class to notify that a wrong date is present in the DatePicker. If this property is disabled, then we cannot specify a wrong value. DatePicker validates the date and changes the date to a valid date. But, this behavior will not work in our version 13.1 and before in Angular mode. DatePicker will add the error class, even when there is a valid date. We have fixed this issue (“DatePicker not works properly in Angular mode”) and it is included in our latest version 13.2.0.29. Our latest version is available for download under the following link

http://www.syncfusion.com/forums/119549/essential-studio-2015-volume-2-final-release-v13-2-0-29-available-for-download

Please upgrade to our latest version then DatePicker will work properly in Angular mode.

Query : i'm handilng errors with bootstrap and ko validation so i do not want that the ejDatePicker add error class to himself. 

If you don’t want DatePicker to validate itself means, set the property “enableStrictMode” to true. Now, DatePicker will allow the user to enter wrong dates but adds an error class. You can hide the red color border by applying the below style.

[CSS]

    <style>

        .e-datewidget.e-error .e-in-wrap {

            border-color:#bbbcbb;

        }

    </style>



Please let us know if you have further queries.

Regards,
HariKrishnan


HO Hostilio July 13, 2015 09:08 PM UTC

You mention that it's fixed in angular mode, but and in knockoutjs?


HP Harikrishnan P Syncfusion Team July 14, 2015 09:25 AM UTC

Hi Hostilio,
 
The reported problem is applicable in both Angular and KnockOut support and the issue is fixed in both the scenario. So please upgrade to our latest version 13.2.0.29 and DatePicker will work properly.
 
Please let us know if you have further queries.
 
Regards,
HariKrishnan


HO Hostilio July 15, 2015 07:26 PM UTC

Thanks


HP Harikrishnan P Syncfusion Team July 16, 2015 03:45 AM UTC

Hi Hostilio,
 
Thanks for your update.
 
Please get back to us if you need any other assistance.
 
Regards,
HariKrishnan P

Loader.
Up arrow icon