2008年12月1日星期一

Re: [fw-mvc] Zend Form: I can't seem to set the name attribute!

-- rollockg <gina-marie.rollock@ntsinteractives.com> wrote
(on Monday, 01 December 2008, 08:17 AM -0800):
>
> I have tried to set the name attribute in Zend Form both by using the setName
> and the setAttrib methods. All I get is id="name", but no name attribute. I
> am using 1.7.

The HTML specification does not allow for a "name" attribute for forms.
setName() on the form will set the id (unless you explicitly set the
id) -- which is what you are seeing here. setName() exists so that there
is a consistent API across the Zend_Form classes.

--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/

没有评论: