3 Replies Latest reply on Apr 7, 2011 11:31 AM by philmodjunk

    Preventing date validation on cancelling record creation

    Frinholp

      Title

      Preventing date validation on cancelling record creation

      Post

      I have created a button which cancels new record creation by effectively deleting the current record.

      A problem arises when a user has filled in a date field with invalid data. When the field is exited by pressing the cancel button, a validation dialog appears.

      It is not very user friendly if a user has to go back to this field and either delete the data or enter a valid date before they can cancel record creation.

      I have been playing around with this for some time now and cannot seem to find an effective solution.

      Ideas anyone?

      Thanks in advance

      Lee

        • 1. Re: Preventing date validation on cancelling record creation
          philmodjunk

          So if you enter an invalid date like 13/13/2011 and then click a cancel button to cancel the new record you get a validation error on the date field?

          Can't think of any way around that short of using a text field to collect the date so that the built in validation date check doesn't fire when you exit the field.

          • 2. Re: Preventing date validation on cancelling record creation
            Frinholp

            So  if you enter an invalid date like 13/13/2011 and then click a cancel  button to cancel the new record you get a validation error on the date  field?

            Yes and also when cancelling a search.

            using a text field to collect the date so that the built in validation date check doesn't fire when you exit the field

            I would like to use the native validation especially to handle a date search due to the multitude of date search options available.

            Cheers Phil

            Lee


            • 3. Re: Preventing date validation on cancelling record creation
              philmodjunk

              Understood, but you can't have it both ways. Either use a text field and "roll your own" delayed validation check or use a field of type date and then any action that exits the date field (such as clicking cancel) first triggers the built in validation.

              Think about it this way. Once you've entered data in the date field, any action you might do to cancel the find or new record first exits the field and this triggers the validation.

              Hmmm, I wonder if you could gin up an OnKeyStroke Triggered script so that pressing Esc runs a script that clears the date field before doing the rest of your cancel operation...