<?php
$data1=$this->am->FetchChildCategory($val[‘category_id’]);
foreach($data1 AS $val1)
{
?>
<div >
<input type="text" id="ccname<?php echo $val1['category_id'];?>" name="ccname<?php echo $val1['category_id'];?>" value="<?php echo $val1['name'];?>"/>
</div>
<div 50px;">
<a id="<?php echo $val1['category_id'];?>" name="<?php echo $val1['category_id'];?>"><font color="blue">Update</font></a>
</div>
<?php
}
?>
From the above code you see that the <input type=“textbox “/> has dynamic id as id=“ccname<?php echo $val1[‘category_id’];?>”.
Now my question is how will I post the value of the textbox in Controller function say UpdateCategory()? Or in other words how shall I get the textbox value in the controller function UpdateCategory()?
In the Controller I wrote as follows:
class Controller extends CI_Controller
{
public function UpdateCategory()
{
$txt=$this->input->post('ccname<?php echo $val1["category_id"];?>');
echo $txt;
}
}
Blank page is coming up. Please help. New to codeigniter.
Thank u all.
Sandip Prasad Ray