This is a migrated thread and some comments may be shown as answers.

[Solved] eclamation when validating

3 Answers 140 Views
Input
This is a migrated thread and some comments may be shown as answers.
Milosz
Top achievements
Rank 1
Milosz asked on 08 Sep 2009, 11:39 AM
hi all
is it possible to set inputs like datepickers when we write wrong date format? i would like to have that nice exclamation when validating input e.g. using RequiredFieldValidator

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 08 Sep 2009, 12:40 PM
Hello Milosz,

The desired functionality is supported only with asp:CustomValidators. You need to do some Javascript coding as well:

http://www.telerik.com/community/forums/aspnet-ajax/input/showing-error-style-programmatically.aspx#710331

The above example is with RadInput textboxes. The RadDatePicker uses internally a RadDateInput textbox, which can be referenced with this client method:

picker.get_dateInput()

so the approach is basically the same.


All the best,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Milosz
Top achievements
Rank 1
answered on 08 Sep 2009, 01:52 PM
ok thanks for that link, i just want to set invalidstyle for all controls in my form (RadNumericTextBox, RadTextbox) the same as in RadDatePicker (RadDateInput) when field is required.

sender.get_styles().EnabledStyle[1] += " riEmpty"; 

is it that style?
0
Dimo
Telerik team
answered on 08 Sep 2009, 02:21 PM
Hello Milosz,

The default invalid CSS class is riError :

sender.get_styles().EnabledStyle[1] += " riError";

Apart from setting it to "EnabledStyle", you can also do the same for the "HoverStyle" and/or "FocusedStyle" - it's according to your preference

Kind regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Input
Asked by
Milosz
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Milosz
Top achievements
Rank 1
Share this question
or