Note that there are some explanatory texts on larger screens.

plurals
  1. PODataTimeControl validation Issues (no clearing error message)
    primarykey
    data
    text
    <p>I write simple WebPart with few asp.net controls. I have problem with validation control and SharePoint date time control. The markup:</p> <pre><code>&lt;SharePoint:DateTimeControl ID="dtc" runat="server" DateOnly="true" HoursMode24="true" OnDateChanged="dtc_DateChanged"/&gt; &lt;asp:CompareValidator ID="valDtc" runat="server" ForeColor="Red" ControlToValidate="dtc$dtcDate" Type="Date" Operator="DataTypeCheck" ErrorMessage="choose or write correct date (YYYY-MM-DD)"&gt; &lt;/asp:CompareValidator&gt; </code></pre> <p>If I write some wrong date I have error message, if I write correct date message disappear. But after I choose other (correct) date from calendar the error message does not disappear (but should). How can I resolve this?</p> <p>EDIT:</p> <p>Trying to use SharePoint:InputFormCompareValidator:</p> <pre><code>&lt;SharePoint:InputFormCompareValidator ID="ifval" runat="server" ForeColor="Red" ControlToValidate="dtc" Type="Date" Operator="DataTypeCheck" EnableClientScript="true" ErrorMessage="choose or write correct date (YYYY-MM-DD)"&gt; &lt;/SharePoint:InputFormCompareValidator&gt; </code></pre> <p>gives me error:</p> <pre><code>[HttpException (0x80004005): Control 'dtc' referenced by the ControlToValidate property of 'ifval' cannot be validated.] System.Web.UI.WebControls.BaseValidator.CheckControlValidationProperty(String name, String propertyName) +11200546 System.Web.UI.WebControls.BaseValidator.ControlPropertiesValid() +50 System.Web.UI.WebControls.CompareValidator.ControlPropertiesValid() +72 System.Web.UI.WebControls.BaseValidator.get_PropertiesValid() +44 System.Web.UI.WebControls.BaseValidator.OnPreRender(EventArgs e) +38 Microsoft.SharePoint.WebControls.InputFormCompareValidator.OnPreRender(EventArgs e) +131 System.Web.UI.Control.PreRenderRecursiveInternal() +108 </code></pre> <p>if I change ControlToValidate="dtc" to "dtc$dtcDate" it behaves the same as CompareValidator and error message does not disappear after choosing good date.</p> <p><img src="https://i.stack.imgur.com/sh8e0.png" alt="Picture:"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload