Sep 30, 2010, 6:09 PM
[CLOSED] DateField validate problem with Vtype="daterange"
I have the following problem with the DateField control, when I set up the property VType = "daterange" the validation of date format does not trip and travels to the server a malformed data. If I did not configure VType property validates the client-side data correctly. As might fix the problem?
this is my example:
income 'aaaaa' in the DateField and when it loses the focus does not show any error message
this is my source code:
this is my example:
income 'aaaaa' in the DateField and when it loses the focus does not show any error message
this is my source code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="CooliteIssue.WebForm2" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script language="javascript" type="text/javascript">
function resetDateFields(field1, field2) {
field1.dateRangeMin = null;
field2.dateRangeMax = null;
field1.setMaxValue();
field2.setMinValue();
field1.reset();
field2.reset();
}
function resetOneField(field1, field2, isMin) {
field1[isMin ? "dateRangeMin" : "dateRangeMax"] = null;
field2[isMin ? "setMaxValue" : "setMinValue"]();
field1.reset();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<ext:ResourceManager ID="smManager" runat="server">
</ext:ResourceManager>
<ext:Panel ID="pnlGeneral" runat="server" Border="true" BodyStyle="padding:5px;">
<Content>
<ext:FormPanel ID="frmGeneral"
runat="server"
MonitorPoll="500"
MonitorValid="true"
AutoWidth="true"
PaddingSummary="8px 8px 0"
BodyStyle="padding:5px;"
Layout="Form">
<Items>
<ext:DateField
ID="dpClosingDate"
runat="server"
Vtype="daterange"
FieldLabel="Closing date"
Width="100"
AllowBlank="false" ShowToday="false">
<Listeners>
<Render Handler="this.endDateField = '#{dpPaymentDate}';" />
<Change Handler="if(Ext.isEmpty(this.getValue(), false)){resetOneField(#{dpClosingDate}, #{dpPaymentDate}, false);}" />
</Listeners>
</ext:DateField>
<ext:DateField
ID="dpPaymentDate"
runat="server"
Vtype="daterange"
FieldLabel="Payment date"
Width="100" AllowBlank="false" ShowToday="false">
<Listeners>
<Render Handler="this.startDateField = '#{dpClosingDate}';" />
<Change Handler="if(Ext.isEmpty(this.getValue(), false)){resetOneField(#{dpPaymentDate}, #{dpClosingDate}, true);}" />
</Listeners>
</ext:DateField>
</Items>
</ext:FormPanel>
</Content>
</ext:Panel>
</div>
</form>
</body>
</html>
Last edited by Daniil; Sep 30, 2010 at 8:08 PM.
Reason: [CLOSED]