What is the correct xml syntax for defining a <multicheckbox> form element in a zend form
I create Zend_Form using an Xml configuration that defines two select and multicheckbox elements. I found a link that answered one of my questions, however I cannot find an example syntax for the multicheckbox element.
any help is appreciated.
here is what i have done so far (for fun)
<?xml version="1.0" encoding="UTF-8"?>
<form>
<localhost>
<formmanager>
<pizza>
<action>/form/</action>
<method>post</method>
<name>Pizza</name>
<elements>
<crust>
<type>Select</type>
<name>crust</name>
<options>
<label>Crust:</label>
<required>true</required>
<multioptions>
<option value="Thin crust">Thin crust</option>
<option value="Thick crust">Thick crust</option>
</multioptions>
</options>
</crust>
<pan>
<type>MultiCheckbox</type>
<required>true</required>
<options>
<label>Pan:</label>
<multioptions>
<option>American Hot</option>
<option>Cheese and tomato</option>
</multioptions>
</options>
</pan>
</elements>
</pizza>
</formmanager>
</localhost>
</form>
+3
1 answer
Solution: . After a long time, looking at the classes Zend_Config, Zend_Config_Xml, Zend_Form_Element_MultiChoiceBox and Zend_Form_Element_Multi, I realized this here too
<?xml version="1.0" encoding="UTF-8"?>
<form>
<localhost>
<formmanager>
<pizza>
<action>/form/</action>
<method>post</method>
<name>Pizza</name>
<elements>
<crust>
<type>Select</type>
<name>crust</name>
<options>
<label>Crust:</label>
<required>true</required>
<multioptions>
<thin_crust>Thin Crust</thin_crust>
<thick_crust>Thick Crust</thick_crust>
</multioptions>
<value>test</value>
</options>
</crust>
<pan>
<type>MultiCheckbox</type>
<name>pan</name>
<options>
<label>Pan:</label>
<multioptions>
<american>American Hot</american>
<cheese>Cheese and Tomato</cheese>
</multioptions>
<required>true</required>
</options>
</pan>
</elements>
</pizza>
</formmanager>
</localhost>
</form>
+4