⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Dropdown list and value selection



naluri2003
  • profile picture
  • Member

Posted 31 January 2017 - 04:25 AM

Hi,

 

I am new to CI and grocery CRUD. Need help with this.

 

I have created a dropdown list:

 

for ($i=0; $i<$info["count"]; $i++)
{
       array_push($userName, $info[$i]["clientname"][0]);
}

 

$crud->field_type('name','dropdown', $userName);

$output = $crud->render();
$this->_example_output($output);

 

 

$userName is an array.

 

Based on the value selected in this dropdown, I want to set another field below it with an associated value based on the array index.

 

How do I get the array index of the value selected in this dropdown list.

 

Appreciate it if someone come provide guidance and examples. :)

 

Thank You.

 

Jo