2 Replies Latest reply on Feb 20, 2016 11:36 AM by DavidZakary

    Possible Bug: Date field in Custom Dialog Box

    AllegroDataSolutions

      One of my clients found this one:

       

      A script displays a dialog and asks the user to enter a date, then creates a new record with that date. This was added to prevent users from submitting booking requests and not specifying when they would like to visit the facility (a common problem). The script works fine if the user enters the date in the format MM/DD/YY or MM/DD/YYYY. But if they type something like "February 22, 2016", a question mark is displaying in the date field and the value is not treated as a date. The data entry field in the dialog is a global field. The data type is "Date". The script simply creates a new record in the table and sets the booking date to the value entered in the dialog.

        • 1. Re: Possible Bug: Date field in Custom Dialog Box
          siplus

          Not a bug - Of course you're getting an error because what you have typed is text. If you want to allow things like "the second friday of july, next year" in your date field, you'll have to do some scripting behind it.

           

          Booking are a serious thing, so you want to be sure of what you get, for example by looping the message till isValid(gDate) AND gDate ≥ Get(CurrentDate).

           

          Helping the user to understand what you want with "Please enter the booking date as MM/DD/YY or MM/DD/YYYY" is also a nice touch.

          • 2. Re: Possible Bug: Date field in Custom Dialog Box
            DavidZakary

            Another option would be to use a modal window as a pseudo-dialog box. This way you'd be able to use a field with a drop-down calendar. You'd be assured of a correctly entered data. Pretty much. As soon as somebody builds a better mouse trap a better mouse will come along. Be careful with the modal window, it is possible to lock yourself into the window with no way to get out.

             

            You might also look at something like Troi Dialog. They have lots of tools for messing with fields in dialog boxes.