Does Zend_Form support numeric keys as a subform name? There's no warning
given as there is with an element name, which you can cast to a string as
below. The idea is to create a form with the index prices[1][1] (and thus
having multiple subforms prices[2][1] etc.

With the following:

$subForm = new Zend_Form_Subform();

$priceForm = new Zend_Form_Subform();
for ($i=1; $i < 5; $i++) {

        // Add the element
        $priceForm->addElement('text', (String) $i, array(
        'required' => true,
        ));

}

$subForm->addSubForm($priceForm, 1);

$this->addSubForm($subForm, 'prices);

Basically when this validates it splits the string in box 1 (I assume due to
array notation) and then puts the next letter in box 2, the next in box 3
and the next in box 4. The same then happens for the second group of form
elements.

With string names as the subform name it works as expected.

Can I use numeric names or should I stick to strings?

Thanks, Simon

-----
Simon

http://www.ajb007.co.uk/
-- 
View this message in context: 
http://www.nabble.com/Using-Zend_Form-with-nested-subforms-tp21593622p21593622.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to