I have Type & Detail table. In Type table, there are Vegetables, Fruit, Juice, etc. When I choose Vegetables, there are Chinese cabbage, Artichoke, Bell pepper, Cauliflower, Malabar spinach, etc in Detail table. I want to build select box for both. Before I choose Type box and if there is no detail for type, I want to disable detail select box.
Under Vegetables Chinese cabbage, Artichoke, Bell pepper, Cauliflower, Malabar spinach,
Under Fruit Orange, Apple,
For Select Box {{ select("type",type,"using":['id','name'],'useEmpty':true,'emptyText':'Choose Type...','class':'form-control','onChange':'addDetail(id)') }} {{ select("type",detail,"using":['typeid','name'],'useEmpty':true,'emptyText':'Choose Detail...','class':'form-control','disabled':'disabled') }}
<script language="javascript"> function addDetail(id) { alert(id.value); } </script> Please help, thanks