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

[Solved] Disabling RadDateTimePicker validation

7 Answers 236 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 20 Jul 2009, 01:37 PM
Hi,

My RadDateTimePicker control is working well, except that when a user enters 31/12/2009 00:00:00 as a date, the client side validation is being triggered. I would like to get rid of this as a user should be able to enter 00:00:00 as a time in my web application.

Thanks,
John

7 Answers, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 22 Jul 2009, 12:42 PM
Hi John,

For solving your problem I recommend you to set the TimeFormat property in the TimeView of the RadDateTimePicker to HH:mm:ss as shown:

 <telerik:RadDateTimePicker ID="RadDateTimePicker1" runat="server" Culture="English (United States)"
            <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"
            </Calendar> 
            <TimeView TimeFormat="HH:mm:ss" /
        </telerik:RadDateTimePicker> 

I hope that this information helps. Please inform us on any further issues.

Sincerely yours,
Mira
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
John
Top achievements
Rank 1
answered on 22 Jul 2009, 01:58 PM
Hi Mira,

Thank you for your reply.

This will not resolve my problem as the time format is already being formatted correctly.

I am displaying 2 RadDateTimePicker controls in a modal popup. When the user clicks cancel, I have a JS function to reset the control values to values contained in a hidden control. This works fine except that for some reason, the client side validation is displaying the values in red and the yellow triangle beside it.

I would like to disable validation as its done by custom events on the server side.

Thanks
John
0
Mira
Telerik team
answered on 22 Jul 2009, 02:24 PM
Hello John,

Could you please send me your project or at least the problematic code so that I can get a more detailed view of the problem.

Thank you for your cooperation in advance.

Greetings,
Mira
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
John
Top achievements
Rank 1
answered on 22 Jul 2009, 03:22 PM
Mira,

It's really very simple - as I have already explained.

I have javascript that clears the value from the DateTimePicker control. When I clear the value, the box is outlined in red and a yellow triangle is displayed within the box.

How can I stop this red outline and yellow triangle from being displayed?


&lt;telerik:RadDateTimePicker ID="dtpStartPeriod" runat="server"&gt;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;DateInput DateFormat="d/M/yyyy HH:mm:ss" DisplayDateFormat="d/M/yyyy HH:mm:ss" runat="server"&gt;&lt;/DateInput&gt;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/telerik:RadDateTimePicker&gt; 


JS:

if (hdnSelectedStart.value != '') {<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//There is a selected date so reset it<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;var startDate = new Date(hdnSelectedStart.value);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctrlAbsoluteStart.set_selectedDate(startDate);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;alert('reset');<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else {<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;//Just clear it<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;alert('cleared');<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ctrlAbsoluteStart.clear();<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;} 




0
Mira
Telerik team
answered on 23 Jul 2009, 09:41 AM
Hello John,

Thank you for the clarification.

I have attached a sample project so that you can see how to clear the data in the RadDateTimePicker in 2 ways - server-side or client -side by JavaScript.

I hope that this will provide the solution to your problem. Do not hesitate to contact us on any further issues.

Regards,
Mira
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
John
Top achievements
Rank 1
answered on 23 Jul 2009, 11:00 AM
Mira,

I don't mean to be rude, but are you even reading my posts?

The JS you provided in that 8mb download is the EXACT same as what I'm using.

Now PLEASE, how do I disable this validation? Using the clear() client side method is triggering the validation.

Regards,
John
0
Mira
Telerik team
answered on 24 Jul 2009, 12:05 PM
Hello John,

Indeed, I have read your post and tried following your steps in order to replicate the described behavior. However I was not able to observe it on my end. Could you please confirm that you reproduce the issue in the sample I sent you?

Do let me know if I missed something from your logic out.

Regards,
Mira
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Calendar
Asked by
John
Top achievements
Rank 1
Answers by
Mira
Telerik team
John
Top achievements
Rank 1
Share this question
or