Method Community

 

Autofilling of date field

Last post 05-29-2012 12:41 AM by Rolf. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-28-2012 1:42 PM

    • Rolf
    • Top 50 Contributor
    • Joined on 09-18-2011
    • Posts 109

    Autofilling of date field

    I have a date field which has associated actions upon change of date. Initially, the field is blank, and as soon as I click on the date selection arrow, it autofills with todays date. That triggers the actions for change of date.  Is there any way to stop the autofilling of todays date when the field is initially blank?

     

    thanks,

    Rolf

  • 05-28-2012 2:09 PM In reply to

    Re: Autofilling of date field

    Rolf:
    Is there any way to stop the autofilling of todays date when the field is initially blank?

    Off the top of my head, you could write a conditional to check for today's date - if it exists then you can assume it was autofilled and not process the DateChanged action.  I'll check the date field action and see if there's a way to skip the autofill action - in the meantime this workaround should work.

    C.

  • 05-28-2012 2:38 PM In reply to

    Re: Autofilling of date field

    Answer

    Rolf:
    Is there any way to stop the autofilling of todays date when the field is initially blank?

    No, this is how the datepicker object works but you can get around this by prepopulating the default value with today's date and time.  If you don't put in a default date, as soon as you click the arrow to put in today's date you trigger the action for date changed since you went from no date to today's date.  If you put in a default date of today and click the arrow then the date change action will only trigger if you change the date from today.  This will work much better and cleaner than my workaround above.

    ~C

  • 05-29-2012 12:41 AM In reply to

    • Rolf
    • Top 50 Contributor
    • Joined on 09-18-2011
    • Posts 109

    Re: Autofilling of date field

    Hi Chad,

    Thanks for the quick replies.  Unfortunately, in my example, Today is a valid choice, but not always what I want, so I have my own workaround for this.

     

    Rolf

     

Page 1 of 1 (4 items)