[fw-general] Define a validator as a certain type, e.g. a warning?

2009-04-30 Thread Colin J
Hi I was wondering if anyone might be able to help. I am working on an application that requires a Zend_Form to have validation checks that are 'errors' which mean the form cannot be posted and some validation checks that might raise a 'warning' to the user. The warnings can then be accepted an

[fw-general] Form Filter for converting to database IDs

2009-02-06 Thread Colin J
Hi I was wondering whether it was appropriate/possible to use a filter on a form element to convert the data into a database ID before passing to the model. For example, an input text field for car manufacturer where the user types 'Ford' or 'Honda' etc. and a filter can run to convert this into

[fw-general] Re: Re[fw-general] ndering a sub form element in a view script

2009-02-02 Thread Colin J
Colin J wrote: > > I was wondering if anyone can help with how to render a single sub form > element in a view script. > > I have a Zend_Form_SubForm and I am attaching this same sub form a number > of times in the Controller, to a Zend_Form, e.g. > > $form = new Zend_

[fw-general] Re[fw-general] ndering a sub form element in a view script

2009-01-30 Thread Colin J
I was wondering if anyone can help with how to render a single sub form element in a view script. I have a Zend_Form_SubForm and I am attaching this same sub form a number of times in the Controller, to a Zend_Form, e.g. $form = new Zend_Form(); for ($i = 1; $i <= 5; ++$i) { $mysubform

Re: [fw-general] Zend Form - Setting element required based on a condition

2009-01-22 Thread Colin J
jkendall wrote: > > I second Martin's suggestion. > > I wrote up how I dealt with this at > http://www.jeremykendall.net/2008/12/24/conditional-form-validation-with-zend_form/ > > Good luck. > > Jeremy, I read your post, it was very useful, thank you. I'm on a mission at the moment to keep

Re: [fw-general] Zend Form - Setting element required based on a condition

2009-01-22 Thread Colin J
Martin Martinov-2 wrote: > > > I don't see anything wrong with your approach but I'm not an expert too > ;-) > However, I believe that the recommended way of doing this is by > creating a custom validator and utilizing the $context parameter. > Take a look at this page in the manual > http://fr

[fw-general] Zend Form - Setting element required based on a condition

2009-01-22 Thread Colin J
Hi Just wanted to check whether this was being done the 'right' way and welcome any feedback. I would like to set a field to be required based on a certain condition, for example, if a form has a 'How would you like to be contacted?' dropdown (of Post or Email) and the user selects 'Email' then