hi i have 2 combo boxes 1) profile and 2) centre and i am setting the value of 1 based on that selected in the 1st. on change of 1st, correct value is displaying in the 2nd, but the no value is getting posted for the 2nd combo in the form.
please let me know where im going wrong. Here is what i have done:
var centre=document.getElementById('centre');
if(profile==1)//super admin
{
centre.value="AD";
centre.disabled=true;
}
else
{
centre.value="";
centre.disabled=false;
}
I am using codeigniter here so my view is :
<td><?php echo form_label('Profile','profile'); ?></td>
<td><?php echo form_dropdown('profile', $profilecombodata,set_value('profile'),$js); ?></td>
<td style="color: red;"><?php echo form_error('profile'); ?><?php echo isset($errors['profile'])?$errors['profile']:''; ?></td>
</tr>
<?php $js ='id="centre" onChange="change_profile(this.value);" ';
?>
<tr >
<td><?php echo form_label('Centre','centre'); ?></td>
<td><?php echo form_dropdown('centre', $centrecombodata,set_value('centre'),$js); ?></td>
<td style="color: red;"><?php echo form_error('centre'); ?><?php echo isset($errors['centre'])?$errors['centre']:''; ?></td>
</tr>