No label and validation shown on inlineRadioButtonList and textArea

Issue #49 resolved
Marvello Oni created an issue

There is no validation and label show up when using inlineRadioButtonList and textArea on the form

Here is my code:

        $Company = Company::model()->findbyPK(Yii::app()->user->getCompany());
        $Currency = Currency::model()->findbyPK($Company->default_currency);
        $ProdType = CHtml::listData(ProductType::model()->findAllByAttributes(array('company'=>$Company->id)), 'id', 'name');
        $brand = CHtml::listData(Brand::model()->findAllByAttributes(array('company'=>$Company->id)), 'id', 'name');
        $outlet = CHtml::listData(Outlet::model()->findAllByAttributes(array('company'=>$Company->id)), 'id', 'name');
        $supplier = CHtml::listData(Supplier::model()->findAllByAttributes(array('company'=>$Company->id)), 'id', 'name');
        $boolean = array(1=>'Yes',0=>'No');

        $form = $this->beginWidget('bootstrap.widgets.BsActiveForm', array(
            'layout' => BsHtml::FORM_LAYOUT_HORIZONTAL,
            'enableAjaxValidation' => true,
            'id' => 'signUpForm',
        ));
        $options = array('prompt' => 'Please Choose One','controlOptions' => array('class' => 'col-lg-6'));
        echo $form->inlineRadioButtonList($model, 'activate',$boolean);
        echo $form->textFieldControlGroup($model, 'barcode',array('controlOptions' => array('class' => 'col-lg-6')));
        echo $form->textFieldControlGroup($model, 'name',array('controlOptions' => array('class' => 'col-lg-6')));
        echo $form->textArea($model, 'description');
        echo $form->fileFieldControlGroup($model, 'image',array('controlOptions' => array('class' => 'col-lg-6')));
        echo $form->dropDownListControlGroup($model, 'brand',$brand, array(
            'prompt' => 'Please Choose One',
            'controlOptions' => array('class' => 'col-lg-6'),
            'help' => CHtml::link('Add new brand','#', array('data-toggle' => 'modal','data-target'=>'#myModal')) 
            ));         
        echo $form->dropDownListControlGroup($model, 'product_type',$ProdType, array(
            'prompt' => 'Please Choose One',
            'controlOptions' => array('class' => 'col-lg-6'),
            'help' => CHtml::link('Add new Product Type','#', array('data-toggle' => 'modal','data-target'=>'#myModal2')) 
            ));
        echo $form->inlineRadioButtonList($model, 'is_service',$boolean);
        echo $form->dropDownListControlGroup($model3, 'outlet',$outlet,$options);
        echo $form->textFieldControlGroup($model3, 'quantity',array('controlOptions' => array('class' => 'col-lg-6')));
        echo $form->dropDownListControlGroup($model3, 'supplier',$supplier,$options);
        echo $form->textFieldControlGroup($model2, 'supply_price', array('placeholder'=>0.00,'prepend' => $Currency->code,'controlOptions' => array('class' => 'col-lg-6')));
        echo $form->textFieldControlGroup($model2, 'markup', array('placeholder'=>0.00,'append' => '%','controlOptions' => array('class' => 'col-lg-6')));
        echo $form->textFieldControlGroup($model2, 'retail_price', array('placeholder'=>0.00,'disabled' => true,'prepend' => $Currency->code,'controlOptions' => array('class' => 'col-lg-6')));
        echo $form->textFieldControlGroup($model2, 'tax', array('value'=>$Company->default_tax,'append' => '%','controlOptions' => array('class' => 'col-lg-6',)));
        echo $form->textFieldControlGroup($model2, 'retail_price_tax',array('disabled' => true,'controlOptions' => array('class' => 'col-lg-6')));
        echo BsHtml::formActions(array(
            BsHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array(
                'color' => BsHtml::BUTTON_COLOR_PRIMARY
            ))
        ));
        $this->endWidget(); 
    ?>

And the result: screeshot.png

Comments (2)

  1. Log in to comment