[Edit: I just realized the title of the post was wrong, it should have read: "RadTimePicker Client-Side validation issue" - Feb.16, 2009]
Hi, I have an issue regarding client-side validation of RadTimeInput with CompareValidators.
The compareValidation always fails, for any value selected in the radTimePickers.
The only case where it doesn't fail, is when there is a starttime without an ending time.
It was based on the example available at:
http://www.telerik.com/help/aspnet-ajax/calendar_webpagesvalidation.html
but the DatePicker were replaced with time pickers.
Using the following code in an aspx file, it is possible to recreate this problem.
It was based on the example available at:http://www.telerik.com/help/aspnet-ajax/calendar_webpagesvalidation.html but the DatePicker were replaced with time pickers.
Hi, I have an issue regarding client-side validation of RadTimeInput with CompareValidators.
The compareValidation always fails, for any value selected in the radTimePickers.
The only case where it doesn't fail, is when there is a starttime without an ending time.
It was based on the example available at:
http://www.telerik.com/help/aspnet-ajax/calendar_webpagesvalidation.html
but the DatePicker were replaced with time pickers.
Using the following code in an aspx file, it is possible to recreate this problem.
It was based on the example available at:http://www.telerik.com/help/aspnet-ajax/calendar_webpagesvalidation.html but the DatePicker were replaced with time pickers.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test3.aspx.vb" Inherits="test3" %> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head runat="server"> |
<title></title> |
</head> |
<body> |
<form runat="server"> |
<asp:ScriptManager runat="server"> |
</asp:ScriptManager> |
<asp:ValidationSummary runat="server" /> |
<table bgcolor="#cccccc"> |
<tr> |
<td> |
Start: |
</td> |
<td> |
<telerik:RadTimePicker ID="StartTime" runat="server"> |
</telerik:RadTimePicker> |
<asp:RequiredFieldValidator runat="server" ID="validator1" ControlToValidate="StartTime" |
ErrorMessage="enter a starting time!" Enabled="false"> |
</asp:RequiredFieldValidator> |
</td> |
</tr> |
<tr> |
<td> |
End: |
</td> |
<td> |
<telerik:RadTimePicker ID="EndTime" runat="server"> |
</telerik:RadTimePicker> |
<asp:RequiredFieldValidator runat="server" ID="validator2" ControlToValidate="EndTime" |
ErrorMessage="enter an ending time!" Enabled="false"> |
</asp:RequiredFieldValidator> |
</td> |
</tr> |
<tr> |
<td> |
</td> |
<td> |
<asp:CompareValidator ID="timeCompareValidator" runat="server" ControlToValidate="EndTime" |
ControlToCompare="StartTime" Operator="GreaterThan" Type="Date" ErrorMessage="The end time must be after the start one." |
Enabled="false"> |
</asp:CompareValidator> |
</td> |
</tr> |
<tr> |
<td colspan="2"> |
<asp:Button runat="server" Text="Submit" ID="Button1" OnClientClick="return OnClick();" /> |
</td> |
</tr> |
</table> |
<script type="text/javascript"> |
function OnClick() { |
ValidatorEnable(document.getElementById("<%=validator1.ClientId%>"), true) |
ValidatorEnable(document.getElementById("<%=validator2.ClientId%>"), true) |
ValidatorEnable(document.getElementById("<%=timeCompareValidator.ClientId%>"), true) |
var isValid = Page_ClientValidate(); |
ValidatorEnable(document.getElementById("<%=validator1.ClientId%>"), false) |
ValidatorEnable(document.getElementById("<%=validator2.ClientId%>"), false) |
ValidatorEnable(document.getElementById("<%=timeCompareValidator.ClientId%>"), false) |
return isValid; |
} |
</script> |
</form> |
</body> |
</html> |