Saving a checkbox value in Yii?

For every input that you are accepting from user, you need to define it in model::rule(). Is active defined there in rule()?

In general, if you are having problems saving to the database, I would replace $model->save(); with if($model->save() == false) var_dump($model->errors); that way, you can see exactly why it did not save. It is usually a validation error.

You can use htmlOptions array to specify value attribute. Below is the code example: labelEx($model,'active');? > checkBox($model,'active', array('value'=>1, 'uncheckValue'=>0));?

> error($model,'active');? > Since version 1.0.2, a special option named 'uncheckValue' is available that can be used to specify the value returned when the checkbox is not checked. By default, this value is '0'.(This text is taken from YII Documenration).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions