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

Validation - Yellow Triangle

10 Answers 307 Views
Input
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 03 Mar 2011, 05:34 PM
Hi,

I notice that the RadDatePicker control has a nice feature - if you put an invalid date into the field, the border of the control turns red and a little yellow triangle with an exclamation mark appears inside the textbox.

Is it possible to do this with a RadTextBox or a RadComboBox?

If so, how do we do this?

Thanks.

Matt.

10 Answers, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 07 Mar 2011, 04:20 PM
Hello Matt,

The described triangle is part of the build-in validation of the RadDatePicker.

Please take a look at the following demos to see how the RadTextBox and the RadComboBox controls can be validated:
Input / Validation
ComboBox / Validation Groups

I hope this helps.

Greetings,
Mira
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Matt
Top achievements
Rank 1
answered on 08 Mar 2011, 11:56 AM
This seems strange.

I'd like my application to have a consistent look and functionality.

However, RadDatePicker and RadTimePicker include this yellow triangle, whereas RadTextBox and RadComboBox do not.

I can include a standard textbox and use the RadInputManager to add the yellow triangle to the textbox, but it seems I can't do that with the RadTextBox.

Also, I'm using RadFormDecorator, and I'm finding that a standard textbox with validation added via RadInputManager had rounded corners, whereas the textbox in RadDatePicker and RadTimePicker both have square corners.

Matt.
0
Mira
Telerik team
answered on 10 Mar 2011, 10:56 AM
Hello Matt,

Thank you for the additional information.

In order to implement the desired look, I recommend that you add the riError style client-side to the desired input element when the text is not valid.

I hope this helps.

Regards,
Mira
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Mike
Top achievements
Rank 2
answered on 16 Mar 2011, 10:48 PM
How do you the riError style to a RadTextBox with a RequiredFieldValidator?  



0
Mira
Telerik team
answered on 19 Mar 2011, 10:54 AM
Hello Mike,

I have followed your scenario and prepared a sample project for you demonstrating how the desired functionality can be implemented. You can find it attached to this message.

I hope it helps.

All the best,
Mira
the Telerik team
0
Robert
Top achievements
Rank 1
answered on 08 May 2013, 06:00 PM
How do I prevent the "Red Border" and "Yellow Exclamation Point Icon" from appearing if the control is blank.    It is appearing when left empty.

I need to allow Nulls for my forms End Date.

Thank you ahead for the help.
0
Vasil
Telerik team
answered on 09 May 2013, 11:25 AM
Hello,

By default they are not shown. Even more such functionality is not embedded, so if they are showing for you, then you have custom script in your page. Remove your script, and it will work as you like.
Check this online demo:
http://demos.telerik.com/aspnet-ajax/calendar/examples/datepicker/custompopup/defaultcs.aspx
And test sample RadDatePicker in your page to see how it behaves:
<telerik:RadDatePicker runat="server" ID="RadDateTimePickerTest">
</telerik:RadDatePicker>


Kind regards,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Justin Maslow
Top achievements
Rank 1
answered on 14 May 2014, 05:32 PM
We are using Telerik version 2012.2.912.40. We also would like to get rid of the yellowish triangle and the exclamation mark that are displayed when an invalid date is entered. You said that by default they are not shown, if they are shown we must have custom script on my page.  Can you give more details? What kind of custom script are you talking about? I don't have any custom script that customize the look and feel of the RadDatePicker. This is my markup:

<telerik:RadDatePicker ID="datePicker1" Width="120" MinDate="1/1/1980" DbSelectedDate='<%# Bind("HireDate") %>'
                                runat="server">
                                <ClientEvents OnDateSelected="hireDateSelected" />
                                <Calendar ID="Calendar1" runat="server">
                                    <SpecialDays>
                                        <telerik:RadCalendarDay Repeatable="Today" ItemStyle-BackColor="#58FA58">
                                        </telerik:RadCalendarDay>
                                    </SpecialDays>
                                </Calendar>
                            </telerik:RadDatePicker>

No custom script, but if I enter an invalid date, the yellow triangle and exclamation mark show up.  I don't want them to show. Any idea? Thank youj.








0
Justin Maslow
Top achievements
Rank 1
answered on 14 May 2014, 06:40 PM
The problem is that the css class .riError defined by telerik contains definition for background as such:

background: url("WebResource.axd?d=EqYOkjlpfChvKqHhdyHm_WG3lx21X9e4RtWtkICqY_oXQ5BUHcAndoLuD5bGxQlYyqBdGTscWR1lXDi9W83oEVdPBS9tuKx2nDMkVIqj103PZ7uaVpDg-XlezkaJP13zMagX7ijWl-H0Gg3U873u4BWafH0-lf2W3oSulVGV8PvZ7cdCPzM6sFDZFNxvMJaY0&t=635222705858351324")
no-repeat scroll 100% -298px #F6F6F6;

To solve the problem, one will have to overwrite this definition with this:

.riError { background: none !important;  }

In your css file.

0
Vasil
Telerik team
answered on 15 May 2014, 11:15 AM
Hello Justin,

I am glad that you have resolved the issue already.

To avoid confusion of future readers:

The Robert request was to not show the error class on empty input. And indeed when the input is empty the class is not applied.
In case there is wrong format value that can not be corrected, the DataInput shows this validation.
You can remove the styles using CSS as you did.

Regards,
Vasil
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Input
Asked by
Matt
Top achievements
Rank 1
Answers by
Mira
Telerik team
Matt
Top achievements
Rank 1
Mike
Top achievements
Rank 2
Robert
Top achievements
Rank 1
Vasil
Telerik team
Justin Maslow
Top achievements
Rank 1
Share this question
or