Ticket #239 (closed defect: invalid)

Opened 4 years ago

Last modified 3 years ago

validation should not stop on first error

Reported by: mpo Owned by: mpo
Priority: critical Milestone: 0.4
Component: modules/kauri-forms Version: trunk
Keywords: Cc:

Description

Sometimes there is more then one validation error in which case it's a bit odd to only show the first error and force the user to submit again before showing the next issue.

(recreated from #217 which got removed after comment-spam)

Change History

comment:1 Changed 3 years ago by jgou

  • Priority changed from minor to critical

comment:2 Changed 3 years ago by freya

Defect seems invalid.

Created a form with 2 controls and 2 validators:

'isSmallerThenOther':

{

validate : function( value) {

if ($.isEmpty(value))

return this.notifySuccess();


var other = basicForm.findControl('/v2');
var otherValue = other.getValue();
if(otherValue && otherValue < value)

return this.notifyFail("i18n:Should be smaller then the other value!");

return this.notifySuccess();

}

} ,

'isPositive':

{

validate : function( value) {

if ($.isEmpty(value))

return this.notifySuccess();


if (value < 0)

return this.notifyFail("i18n:Should be positive!");


return this.notifySuccess();

}

}

everything acts as espected.

comment:3 Changed 3 years ago by freya

  • Status changed from new to closed
  • Resolution set to invalid

comment:4 Changed 3 years ago by idbr

I don't think this issue is invalid. With the following form

  members: {
    'test1': {
      base: 'string',
      '+validators': { 'required': {} }
    },
    'test2': {
      base: 'string',
      '+validators': { 'required': {} }
    }
  }

on kauri r1504, when i press submit, only for the first input field a warning is displayed. Tested in FF3.6.3, IE7 and Chrome4.1.

comment:5 Changed 3 years ago by mpo

Checking up this should have received a fix in r1505

Note: See TracTickets for help on using tickets.