vikas02121
(Vikas02121)
1
Hi
How can I set up the class for my form?
I have my customized CSS and I want to apply that to all my forms but I am unable to set up the class of the form.
Please help.
Thanks,
Vic
[b]<?php $form=$this->beginWidget(‘CActiveForm’, array(
'id'=>'getscores-form',
'enableClientValidation'=>true,
'clientOptions'=>array(
'validateOnSubmit'=>true,
),
)); ?>[/b]
scspl.pravin
(Phpwebdeveloper900)
2
Hi,
you have put your custom css under css folder than call your css on your view/layout/anyfile(those you are calling) like this way.
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->baseUrl; ?>/css/stylesheet.css" media="screen, projection" />
Thanks
andy_s
(Arekandrei)
3
Use CActiveForm.htmlOptions:
$form=$this->beginWidget('CActiveForm', array(
'id'=>'getscores-form',
'enableClientValidation'=>true,
'clientOptions'=>array(
'validateOnSubmit'=>true,
),
'htmlOptions'=>array(
'class'=>'my-form-class',
),
));