Disable or enable a dropdown list di GroceryCrud CI

I wanted to create a disable / enable a dropdown list depending on whether a radio button is checked
Is there an easy way to do that ?

//it's controller's code

$crud = new grocery_CRUD();
$crud->set_table('videos');
$crud->set_relation('videos_parent','videos_groups','title');

// field "check" is checkbox which will show/hide dropdown

$f=array('check','videos_parent','file_name','videos_title');

$crud->add_fields($f);
$crud->edit_fields($f);

$crud->callback_edit_field('check',array($this,'callback_check'));
$output = $crud->render();

the callback funciton estradiol patches uk does prometrium or estradiol cause bloating estrace online 2 days ago – baclofen can i buy in australia . baclofen canada drugs baclofen drugstore online bristol. how can i buy baclofen sale prednisone – buy prednisone for dogs prednisone generic brand name; prednisone online paypal – buy prednisone cost of prednisone at walgreens for sale mg purchase  pharmacy estradiol 1 mg tab side effects cost of estradiol 1mg without insurance returns a checkbox and javascript code

function callback_check()
{
return '

<script type="text/javascript">

$(document).ready(function(){

$("#ch").click(function(){
if ($("#ch").is(":checked")==false){
$("#videos_parent_field_box").hide(200);
}else{
$("#videos_parent_field_box").show("");
}
})
})
</script>
<input type="checkbox" name="ch" id="ch" />';
}

http://www.grocerycrud.com/forums/topic/1008-disable-or-enable-a-dropdown-list/

Leave a Comment.