Welcome Guest, Not a member yet? Register   Sign In
How To Get Departments Based on Course
#3

[eluser]prakash[/eluser]
Everything is working fine

In my form it should display all the departments in a drow down list when i select an particular course in drop down list

generally we use

onchange="document.frm.submit();


but for this ci form what we should write?

(eg: if we select country based on country it should display states in that particular country)

Code:
<tr class=“fieldbox”>
<td width=“311” align=“right” height=“23”>
&lt;?php echo form_label(‘Courses’,‘course’); ?&gt;</td>
      <td width=“33”> :      </td>    
    <td width=“431” colspan=“2”>&lt;?php
  $course = $this->db->query(“select * from courses”);
    foreach($course->result() as $courses)
  {
  $coursenames[]= $courses->course_name;
  }

    echo form_dropdown(‘Courses’, $coursenames, ‘course’);?&gt;      </td>
  </tr>

  <tr class=“fieldbox”>
  <td width=“311” align=“right” height=“23”>&lt;?php echo form_label(‘Department’,‘dept’); ?&gt;      </td>
      <td width=“33”> :      </td>    
    <td width=“431” colspan=“2”>&lt;?php
  $dept = $this->db->query(“select * from departments”);
    foreach($dept->result() as $depts)
  {
  $ddata[]= $depts->dept_name;
  }

    echo form_dropdown(‘departments’, $ddata, ‘dept’);?&gt;      </td>
  </tr>


Messages In This Thread
How To Get Departments Based on Course - by El Forum - 02-17-2012, 01:17 AM
How To Get Departments Based on Course - by El Forum - 02-17-2012, 01:39 AM
How To Get Departments Based on Course - by El Forum - 02-17-2012, 01:59 AM
How To Get Departments Based on Course - by El Forum - 02-17-2012, 04:58 AM
How To Get Departments Based on Course - by El Forum - 02-17-2012, 06:03 AM
How To Get Departments Based on Course - by El Forum - 02-19-2012, 10:08 PM
How To Get Departments Based on Course - by El Forum - 02-20-2012, 12:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB