Welcome Guest, Not a member yet? Register   Sign In
getting the select value
#5

[eluser]CroNiX[/eluser]
Code:
public function getPageInfo($parentID)
{
  $sql = "select ID, CATEGORY_NAME from igs_page_category where CATEGORY_PARENT_ID in ($parentID)";
  $query = $this -> db -> query($sql,$parentID);
  if ($query -> num_rows() > 0)
  {
   foreach ($query->result_array() as $row)
   {
    $ctg_ids[$row['ID'] = $row['CATEGORY_NAME'];  //changed this
   }
   return $ctg_ids;
  }
}
Code:
//in the view
echo form_dropdown('ID', $ctg_ids, set_value('ID', 0));
will create the dropdown, it's options, select the current value (if form was submitted), or select whatever has the value of 0 if the form hasn't been submitted (a default value, like "Choose ID")


Messages In This Thread
getting the select value - by El Forum - 07-12-2012, 10:56 AM
getting the select value - by El Forum - 07-12-2012, 01:02 PM
getting the select value - by El Forum - 07-12-2012, 01:03 PM
getting the select value - by El Forum - 07-12-2012, 01:07 PM
getting the select value - by El Forum - 07-12-2012, 01:07 PM
getting the select value - by El Forum - 07-12-2012, 01:26 PM
getting the select value - by El Forum - 07-12-2012, 01:42 PM
getting the select value - by El Forum - 07-12-2012, 02:46 PM
getting the select value - by El Forum - 07-12-2012, 02:59 PM
getting the select value - by El Forum - 07-12-2012, 03:03 PM
getting the select value - by El Forum - 07-15-2012, 04:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB