vamp
(Vamphouse)
February 25, 2010, 1:59pm
1
I use subforms, like:
'title'=>'Advertiser',
'elements'=>array(
'company'=>array(
'type'=>'form',
'title'=>'General',
'elements'=>array(
'full_name'=>array('type'=>'text'),
'trade_name'=>array('type'=>'text'),
'head_name'=>array('type'=>'text'),
'head_position'=>array('type'=>'text'),
'head_activity'=>array('type'=>'text'),
),
),
Code of subform, generated by CForm, looks like:
<fieldset type="form" name="company"> ....
Questions :
Where is legend of subform and how I can display it?
"type" and "name" are invalid attributes for fieldset tag, maybe before rendering… CForm attributes need to be cleaned?
intel352
(Jon)
February 25, 2010, 2:33pm
2
To use a sub-form:
http://www.yiiframework.com/doc/guide/form.builder#specifying-sub-form
Any attributes that CForm doesn’t recognize, it typically passes on to the generated HTML as element attributes.
vamp
(Vamphouse)
February 26, 2010, 8:30am
3
try to reproduce my example (nested subforms) and check output (intel352, it silly , I checked latest version of manual from SVN twice before create this post)
intel352
(Jon)
February 26, 2010, 4:21pm
4
If you remove ‘name’=>‘General’, it removes that fieldset reference, hehe.
I agree that the results aren’t what you’d necessarily expect :-\
vamp
(Vamphouse)
March 1, 2010, 1:33pm
5
Hey, maintainers, help to solve problem!
qiang
(Qiang Xue)
March 1, 2010, 3:54pm
6
Thanks. I’ve fixed this bug.
Was this an error in documentation, or in the code?
Does this change what CForm expects?
qiang
(Qiang Xue)
March 1, 2010, 4:06pm
8
It’s a bug in code: legend for subforms are not rendered, and ‘name’ and ‘type’ should not be rendered for fieldset tag.