Skip navigation
sparrowce
Currently Being Moderated

Date Field - allows any string?

Jul 5, 2012 6:38 AM

I am using a standard date/time field on LC form, data format = date.  However, it lets users enter any string, and am needing it to only be date.  I will set a validation pattern, but before setting, want to be sure first, is this normal, that a date field allows any type of string to be manually entered (they used Sept. 30, 2014 as their answer, and when I imported the response into Access, of course it didn't pass the Access side of bringing into a date field).

 

One thing I've noticed is you have to place your cursor in the date fields before the drop-down date picker will show.  Is there a future plan to have the drop-down arrow show even if no cursor in field?  Just an 'enhancement' request, as someone may not notice that and keep typing.  I had wrongly assumed a date field would only accept date formatted data, so as a workaround, am setting validation patterns, but was hoping for a better understanding of this field for the future.  Thank you!

 

Message was edited by: sparrowce Additional info - when I test validation, have set everything to the date pattern needed, and in testing, it will give the error message if I enter a string, but then the field still accepts the string.  Am needing to know how to properly validate the date field, thank you!

 
Replies
  • Currently Being Moderated
    Jul 5, 2012 3:14 PM   in reply to sparrowce

    Hi,  This is standard behaviour and is the same for a decimal field once you add an edit format like num{$zzzz9.99} you can type whatever you want.  So you will need to validate the value yourself.  If the value entered matches the edit pattern then it will be converted to the internal format of YYYY-MM-DD, if not then the invalid value will be copied across as it.  This means that as long as your display pattern is not YYYY-MM-DD an invalid date will be one that has a formattedValue == rawValue.  You may need multiple edit formats as well to allow different formats to be entered.

     

    These posts my help;

     

    http://cookbooks.adobe.com/post_An_alternative_Date_Picker_for_LiveCyc le_Designer-18455.html

     

    http://cookbooks.adobe.com/post_Date_handling_in_Livecycle_Designer_ES _forms-19697.html

     

    Regards

     

    Bruce

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points