Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Non blocking validators

    Hi, just a question:

    Do non-blocking (server) validators exist?

    E.g
    field_capacity = 200
    field_booked = 150

    validator on field booked:
    if (booked > capacity) set blocking validation with message "Overbooked!" (so a user must do some manual work to get booked under capacity)
    if (booked > capacity - 20) set non blocking validation with message "Almost sold out"
    else don't set any validation icon


    When the window with these fields on is opened, we could perform a form.validate() to immediately show validation errors on these items. We show all validation messages on top of the screen, so immediately the user sees the message "Almost sold out".

    #2
    Presumably you've already looked at the DMI Validation samples in the EE Showcase - these show non-blocking validators. What exactly is your question - is the behavior you talk about something you want to achieve, or something you don't want to happen?

    Comment


      #3
      Thanks, I'll have a deeper look in that sample how it works exactly.

      My thoughts are more what form.validate() which returns just a boolean does with blocking and non-blocking validation errors; if the framework 'knows these' at all and treats them differently.

      Comment

      Working...
      X