Bug Tracker

Opened 12 years ago

Closed 12 years ago

#2456 closed feature (fixed)

[validate] Accept dependency expression for every method

Reported by: joern Owned by: joern
Priority: major Milestone:
Component: plugin Version:
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by joern)

Usage:

billingAddress: {
  required:true,
  minlength:5
  equalTo: {
    param: "#shippingaddress",
    depends: "#compare:checked"
  }
}

Here the billing address must be the same as the shipping addres, but only if some checkbox #compare is checked.

Every method'd accept that {depends:expression} object as the parameter, skipping the method if it doesn't match. The expression is the same as what required accepts, but doesn't kill the chain as required does. Even required can accept the depends parameter.

Implementation: Extend normalizeRule to check for the parameter. If it has a depends-property, evaluate it. If it returns true, return a normal {name:param} rule. If not, drop the rule. Return normal rule if no param specified or no depends-property.

Change History (4)

comment:1 Changed 12 years ago by joern

Description: modified (diff)

comment:2 Changed 12 years ago by joern

Resolution: fixed
Status: newclosed

Fixed in [4862]. Thanks Dan!

comment:3 Changed 12 years ago by scott.gonzal

Resolution: fixed
Status: closedreopened

Jörn closed the wrong ticket...

comment:4 Changed 12 years ago by scott.gonzal

Resolution: fixed
Status: reopenedclosed

Fixed in [4872] and [4889].

Note: See TracTickets for help on using tickets.