chrismiles / EZForm

iOS form handling and validation library.
MIT License
284 stars 64 forks source link

How to dinamically remove a Validator from a field #71

Open appfabtech opened 9 years ago

appfabtech commented 9 years ago

Hello I need to handle my form dinamically. I mean to enable and disable validation on certain fields due to other constraints More in detail I have an email field (set by default with addValidator:EZFormEmailAddressValidator) I need to disable in a specific condition (so that EZform doesn't check if it contains an email address) Is there a way to do it?

Thanks

Paolo

chrismiles commented 9 years ago

A recent change adds -[EZFormField setValidator:] so you can replace validators on a field. Passing nil will clear validators, so you could use this to clear and re-set validators as you need them.