Hello,
I new to yii framework. i am working on a sample project and got stuck at a point
and I don’t know how to proceed from there. Please help me
in my active record form i have a combobox and a textfield. combobox is retriving data from a table.
my problem is i want the textbox to show the data according to combobox selection.
my table is having three columns
sid | share_name | exchange_rate
1 | gold | 100
2 | zinc | 30
3 | lead | 50
if I select the gold from the combobox it should display 100 in the textbox and if i select zinc from the combobox the textbox should display 30 and likewise.
i tried it do.but its not working, may be i am missing something…please help…
code for combobox
<?= $form->field($model,‘Share_Name’)->dropDownList(
ArrayHelper::map(Sharename::find()->all(),'Share_Name','Share_Name'),array('onchange'=[b]><img src='http://www.yiiframework.com/forum/public/style_emoticons/default/huh.gif' class='bbc_emoticon' alt='???' />?[/b]), ['prompt'=>'Select Share']
) ?>
code for textbox
<?= Html::textInput( ‘Exchange_Rate’, ‘sid’, array(‘id’=>‘Exchange_Rate’)) ?>