CodeIgniter Forums
Auto Fill Textbox Field - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Auto Fill Textbox Field (/thread-49771.html)



Auto Fill Textbox Field - El Forum - 03-02-2012

[eluser]glenconde[/eluser]
hi Igniters!

I have a bit of a problem here.. i don't know how to get the value of my textbox field,
i wanted to auto fill textbox wth the result of the computation on my code..
help thanks!

Code:
<div class="field_row clearfix">
&lt;?php echo form_label($this->lang->line('items_cost_price').':', 'cost_price',array('class'=>'required wide')); ?&gt;
<div class='form_field'>
&lt;?php echo form_input(array(
  'name'=>'cost_price',
  'size'=>'8',
  'id'=>'cost_price',
  'value'=>$item_info->cost_price)
);?&gt;
</div>
</div>

<div class="field_row clearfix">
&lt;?php echo form_label($this->lang->line('items_unit_price').':', 'unit_price',array('class'=>'required wide')); ?&gt;
<div class='form_field'>
&lt;?php echo form_input(array(
  'name'=>'unit_price',
  'size'=>'8',
  'id'=>'unit_price',
  'value'=>$item_info->cost_price/0.7) <-- MY COMPUTATION
);?&gt;
</div>
</div>



I have a textbox for this two:

Cost Price : _______
Unit Price : _______ <-- auto fill from the result computation

Thank you in advance!