Opened 15 years ago
Closed 15 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 )
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 15 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 Changed 15 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Jörn closed the wrong ticket...
comment:4 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Fixed in [4862]. Thanks Dan!