2008年7月31日星期四

[fw-mvc] Problems with subForms

For an event registration I need a registration form n-times, as n is the
count of sessions or subevents of a main event.

I build an form template for one session with Zend_Form_SubForm. The result
is:

<dt>&nbsp;</dt><dd><fieldset id=""><dl>
<dt><label for="EVENT_ID" class="optional">Veranstaltung</label></dt>
<dd>
<select name="EVENT_ID" id="EVENT_ID" class="">
...options...
</select></dd>
</dl></fieldset></dd>

Then I create an empty form with Zend_Form and add the n SubForms to it:

foreach($aSessions as $aSession) {
$oForm->addSubForm($oSubForm, 'session_'.$aSession['EVENT_ID']);
}

What I get ist: all Subforms will have the same Id:

<form enctype="application/x-www-form-urlencoded"
action="event/registration/addtosession/event/11/part/3" method="post"><dl
class="zend_form">
<dt>&nbsp;</dt><dd><fieldset id="session_16"><dl>
<dt><label for="EVENT_ID" class="optional">Veranstaltung</label></dt>
<dd>
<select name="session_16[EVENT_ID]" id="EVENT_ID" class="">
... options ...
</select></dd>
</dl></fieldset></dd>
<dt>&nbsp;</dt><dd><fieldset id="session_16"><dl>
<dt><label for="EVENT_ID" class="optional">Veranstaltung</label></dt>
<dd>
<select name="session_16[EVENT_ID]" id="EVENT_ID" class="">
... options ...
</select></dd>
</dl></fieldset></dd>
...
<dt>&nbsp;</dt><dd>
<input type="submit" name="submit_btn" id="submit_btn"
value="SUMIT"></dd></dl></form>

What do I wrong?

Thank you

Axel

--
View this message in context: http://www.nabble.com/Problems-with-subForms-tp18751896p18751896.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: