02-17-2012, 01:59 AM
[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)
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”>
<?php echo form_label(‘Courses’,‘course’); ?></td>
<td width=“33”> : </td>
<td width=“431” colspan=“2”><?php
$course = $this->db->query(“select * from courses”);
foreach($course->result() as $courses)
{
$coursenames[]= $courses->course_name;
}
echo form_dropdown(‘Courses’, $coursenames, ‘course’);?> </td>
</tr>
<tr class=“fieldbox”>
<td width=“311” align=“right” height=“23”><?php echo form_label(‘Department’,‘dept’); ?> </td>
<td width=“33”> : </td>
<td width=“431” colspan=“2”><?php
$dept = $this->db->query(“select * from departments”);
foreach($dept->result() as $depts)
{
$ddata[]= $depts->dept_name;
}
echo form_dropdown(‘departments’, $ddata, ‘dept’);?> </td>
</tr>