Yii Framework Forum: Radio Button - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Radio Button Tentang radio button Rate Topic: -----

#1 User is offline   jimmi nababan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 12-October 09

Posted 21 July 2010 - 06:14 AM

Hai semua,

Saya mau tanya tentang radio button. Berikut pertanyaannya :

saya punya form pake radio button begini

<div class="row">
<?php echo $form->labelEx($model,'jnsKelamin'); ?>
<?php echo $form->radioButton($model,'jnsKelamin',array('value'=>'Laki')) . 'Laki'; ?>
<?php echo $form->radioButton($model,'jnsKelamin',array('value'=>'Cewe')) . 'Cewe'; ?>
<?php echo $form->error($model,'jnsKelamin'); ?>
</div>

pada saat disubmit
kenapa kalau laki yang dipilih, valuenya 0 ?
sedangkan kalau cewe valuenya benar 'Cewe'

kayaknya sih ini perlu penamaan radiobutton yg satu group gitu, tapi gmn buatnya ya kalau di yii.
karena sepertinya radiobutton yang terakhir itu bisa dibaca.

makasih.
0

#2 User is offline   jimmi nababan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 12-October 09

Posted 25 July 2010 - 02:58 AM

bantuin donk ???
makasih..
0

#3 User is offline   __agus 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 166
  • Joined: 22-April 10
  • Location:Yogyakarta, Indonesia

Posted 25 July 2010 - 09:27 PM

View Postjimmi nababan, on 25 July 2010 - 02:58 AM, said:

bantuin donk ???
makasih..


coba di dump pake print_r($_POST) pada action bersangkutan. semoga membantu. :)
0

#4 User is offline   fastcrash 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 245
  • Joined: 10-March 10
  • Location:South Jakarta

Posted 25 July 2010 - 10:52 PM

<div class="row">
<?php echo $form->labelEx($model,'jnsKelamin');
$accountStatus = array('Male'=>'Male', 'Female'=>'Female');
echo $form->radioButtonList($model,'jnsKelamin', $accountStatus, array('separator'=>' ', 'labelOptions'=>array('style'=>'float:left;'), 'style'=>'float:left;'));
echo $form->error($model,'jnsKelamin');
?>
</div>


sorry for late reply 8)
0

#5 User is offline   jimmi nababan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 12-October 09

Posted 11 August 2010 - 02:50 AM

great !!!. succeed.

thanks a lot.



View Postfastcrash, on 25 July 2010 - 10:52 PM, said:

<div class="row">
<?php echo $form->labelEx($model,'jnsKelamin');
$accountStatus = array('Male'=>'Male', 'Female'=>'Female');
echo $form->radioButtonList($model,'jnsKelamin', $accountStatus, array('separator'=>' ', 'labelOptions'=>array('style'=>'float:left;'), 'style'=>'float:left;'));
echo $form->error($model,'jnsKelamin');
?>
</div>


sorry for late reply 8)

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users