Hi all,<br><br>I would like to enhance the "when" attribute to accept something like this:<br><br>- type: Password<br> name: password2<br> label: Retype Password<br> constraints:<br> − type: Equal
<br> others: password<br> when:<br> field: password<br> - type: Required<br> when:<br> stash: is_create<br> value: true
<br><br><br>So when the "when" attribute receives a "field" attribute without a "values" attribute it returns true if the field is filled. Another enhance is to receive a "stash" attribute that works like the "field" attribute but checks the stash instead. However it makes it impossible to use both "field" and "stash" attributes at the same time because the "values" attribute can't work for both at the same time. To handle that we can make "field" and "stash" accept an hash ref. The config would look like:
<br><br> when:<br> field:<br> name: foo<br> values: [1, 2, 3]<br> stash:<br> name: bar<br> values: [4, 5, 6]<br> <br>And it would do an intersection between the two. If we need an union it could be something like this:
<br><br> when:<br>
- type: field<br>
name: foo<br>
values: [1, 2, 3]<br>
- type: stash<br>
name: bar<br>
values: [4, 5, 6]<br><br>Another thing that I miss is a way to specify how I want the values to be compared. Sometimes I don't want to use "eq" and a regex would be more appropriated:<br><br> when:
<br> field:<br>
name: foo<br>
regex: /^\d+$/<br> <br><br>Comments on this?<br><br>-- <br>Jonas<br>