Yii Framework Forum: Fill Text Field Based On Drop Down List Select - Yii Framework Forum

Jump to content

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

Fill Text Field Based On Drop Down List Select Rate Topic: -----

#1 User is offline   Kirenga 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 03-August 17

Posted 20 September 2017 - 04:38 AM

Hi! i have a problem, i am having 2 tables one is Package and another is
package type this package type contains type of package and price.
So in package i have one dropdwon list which contains all package type from package type table and text field of price.
what i want is when user select package type and price field fill automatic according to the package type,
(package type and price from the same table)

in my package _view

<div class="form-group">
<?php echo $form->labelEx($model,'package_type_id'); ?>
<?php
echo $form->DropDownList($model,'package_type_id',
CHtml::listData(PackageType::model()->findAll('status!="0"'),'id','name'),
array('prompt'=>'-- Package type --'));
?>
<?php echo $form->error($model,'package_type_id'); ?>
</div>

//Text to update
<div class="form-group">
<?php echo $form->labelEx($model,'unity_price'); ?>
<?php echo $form->textField($model,'unity_price'); ?>
<?php echo $form->error($model,'unity_price'); ?>
</div>

//In packagecontroller

public function actionGetprice(){

??????????????????????????????


}
I hope all this are understandable because I am not fluent in English.

Thanks for any help!
0

#2 User is offline   chandran 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 561
  • Joined: 08-October 12
  • Location:Austria

Posted 20 September 2017 - 05:29 AM

Hi,

Please go through this links for example

http://www.yiiframework.com/wiki/24/

http://www.yiiframew...cratch-in-yii2/
Thanks
chandran nepolean

My own extension:
http://www.yiiframew...sion/ejqueryte/
http://www.yiiframew...uallistboxyii1/

My wiki
http://www.yiiframew...checkboxcolumn/

If it work dont hesitate to click +1 button
0

#3 User is offline   Kirenga 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 03-August 17

Posted 20 September 2017 - 06:33 AM

thank you let me check
0

#4 User is offline   Kirenga 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 03-August 17

Posted 20 September 2017 - 06:36 AM

please can u give a sample depending on my problem ,i am new so please guide me step by step.
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