iqdavid
(Sistemas)
1
Hi!
I’m triying to set the css class in an active form
Setting the active form looks like this:
$paramForm['id']='currentuser_form';
$paramForm['enableAjaxValidation']=FALSE;
$form=$this->beginWidget('CActiveForm', $paramForm);
This render the following:
<form id="currentuser_form" action="/vm/adm/dashboard/current_user" method="post">
My question is how can I add the metatag class=“my_form_class” to the active form, if I try $paramForm[‘class’]=‘my_form_class’;
It brokes!!
Thanks!!
kokomo
(Mwerlberger85)
2
CActiveForm.htmlOptions is what you are looking for 
iqdavid
(Sistemas)
3
Thanks kokomo!
just to close my question… the code to add a css class to an ActiveForm is the following:
$paramForm['id']='currentuser_form';
$paramForm['enableAjaxValidation']=FALSE;
$htmlOptions['class']='my_form_class';
$paramForm['htmlOptions']=$htmlOptions;
$form=$this->beginWidget('CActiveForm', $paramForm);
The render result is
<form class="my_form_class" id="currentuser_form" action="/vm/adm/dashboard/current_user" method="post">
Thanks