北京过客
public function rules() { // NOTE: you should only define rules for those attributes that // will receive user inputs. return array( array('username, password, question, answer, type', 'required'), array('username, password', 'length', 'max'=>128), array('verifyCode', 'captcha', 'allowEmpty'=>!CCaptcha::checkRequirements()), ); } public function attributeLabels() { return array( 'id' => '用户ID', 'username' => '用户名', 'password' => '密码', 'password2' => '再次输入密码', 'regtime' => '注册时间', 'question' => '密保问题', 'answer' => '密保答案', 'type' => '会员类型', 'verifyCode'=>'验证码', ); }
public $verifyCode; public $username; public $password; public $password2; public $regtime; public $question; public $answer; public $type;
<?php echo $form->radioButtonList($model,'type',array('0'=>'个人会员', '1'=>'企业会员'),array('template'=>'<span class="radio">{input}{label}</span> ','separator'=>'')); ?>
怎么提交的时候提示“会员类型不可为空白”。这个字段是type,请问哪不对呀
默认值怎么搞
<?php echo $form->radioButtonList($model,'type',array('0'=>'个人会员', '1'=>'企业会员'),array('template'=>'<span class="radio">{input}{label}</span> ','separator'=>'')); ?>
我这样就可以了
你是不是把span定义CSS了?默认值怎么搞
<input id="ytUser_type" type="hidden" value="" name="User[type]" /> <input id="User_type_0" value="0" type="radio" name="User[type]" /> <label for="User_type_0">个人会员</label> <br/> <input id="User_type_1" value="1" type="radio" name="User[type]" /> <label for="User_type_1">企业会员</label>
中间换行了,能不能让它不换行,还有默认值怎么加
- 北京过客 发布了话题多条件where怎么find啊?
- 北京过客 回复了话题 哈哈...从别处偷来的,希望能帮上忙!随便灌水!
挺好的,收下了,谢谢