[CLOSED] DateField: How to disable auto correct?

  1. #1

    [CLOSED] DateField: How to disable auto correct?

    Hi,

    When I type in 00-May-2011, it will auto correct to 30-Apr-2011.
    When I type in 35-May-2011, it will auto correct to 04-Jun-2011.

    How can I disable this feature and display it to user as invalid dates?

    Thanks.

    <ext:DateField ID="dfDateRangeFrom" runat="server" EndDateField="dfDateRangeTo" 
         Vtype="daterange" Format="dd-MMM-yyyy" Width="120" 
         AltFormats="d-MMM-yyyy|d-M-yyyy|d-M-yy|d/MMM/yyyy|d/M/yyyy|d/M/yy">
      <ToolTips>
        <ext:ToolTip ID="ToolTip_dfDateRangeFrom" runat="server" 
             Html="Press <b>ENTER</b> to activate filter" />
      </ToolTips>
      <Listeners>
        <SpecialKey Fn="enterKeyPressHandler" />
      </Listeners>
    </ext:DateField>
    <ext:DateField ID="dfDateRangeTo" runat="server" StartDateField="dfDateRangeFrom" 
         Vtype="daterange" Format="dd-MMM-yyyy" Width="120" 
         AltFormats="d-MMM-yyyy|d-M-yyyy|d-M-yy|d/MMM/yyyy|d/M/yyyy|d/M/yy">
      <ToolTips>
        <ext:ToolTip ID="ToolTip_dfDateRangeTo" runat="server" 
             Html="Press <b>ENTER</b> to activate filter" />
      </ToolTips>
      <Listeners>
        <SpecialKey Fn="enterKeyPressHandler" />
      </Listeners>
    </ext:DateField>
    Last edited by Daniil; Dec 12, 2011 at 3:05 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please investigate this thread:
    http://forums.ext.net/showthread.php?15715
  3. #3
    Hi Daniil,

    Thanks for the reply but it was not helpful with respect to my issue.

    I tried to add
    <Render Handler="this.beforeBlur = this.beforeBlur.createInterceptor(myBeforeBlur);" />
    and then manually check for invalid dates (i.e. 00-May-2011) and then use "this.markInvalid();",
    but it still change into "30-Apr-2011". I read than this is due to DateField/ExtJS date parser, does this mean there is no solution or any way to cancel the auto-correct?

    Thanks, J
  4. #4
    Please look at this example:
    http://forums.ext.net/showthread.php...ll=1#post69779

    Though you should implement a respective validator for your case.
  5. #5
    Sorry. Just noted in Post #6 that it is not possible.

Similar Threads

  1. [CLOSED] Disable Validation Tooltip in DateField
    By softmachine2011 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 02, 2012, 1:52 PM
  2. [CLOSED] How to disable typing on a DateField
    By hgouw in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Oct 27, 2011, 11:21 PM
  3. Replies: 20
    Last Post: Feb 23, 2011, 5:49 PM
  4. [CLOSED] DateField with days disable
    By 78fede78 in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Oct 01, 2010, 2:26 PM
  5. Disable DateField using Javascript
    By Suraj in forum 1.x Help
    Replies: 2
    Last Post: Sep 14, 2009, 5:42 PM

Posting Permissions