Hi drewm
It would be handy if we can use multiple form validators on a single input field.
A use-case I'm currently dealing with is checking whether a member's phone number is unique and whether it is a valid phone number. While it is possible to perform all checks with a single validator function, it doesn't seem to be possible to have different error messages for each validation type:
Perhaps the helper attribute could have a suffix to specify the type:
HTML
- <perch:input id="phone"
- type="text"
- required
- helper-unqiue="MyApp_Validators::is_phone_unique"
- helper-format="MyApp_Validators::is_phone_valid"
- >
- <perch:error for="phone" type="helper-unqiue"></perch:error>
- <perch:error for="phone" type="helper-format"></perch:error>
- <!--* OR *-->
- <perch:error for="phone" type="unqiue"></perch:error>
- <perch:error for="phone" type="format"></perch:error>