Outline ·
[ Standard ] ·
Linear+
JavaScript Checkbox control HIDE or SHOW Drop-Down List, list of Checkbox controls list of DDL
|
exentric_nova
|
Apr 15 2010, 10:15 PM
|
|
I have done this before and it really was quite easy. Yes, you will be needing the ID of the drop down list. My method is inserting that ID within the checkbox value. Once the checkbox is checked/unchecked, my script will capture the value of said checkbox, and toggle view according to the ID captured. Different checkbox will have different value hence toggling different drop down list. I can give an example of code, but are you using any framework or just plain Javascript? Since I'm only capable of doing JS using JQuery
|
|
|
|
|
|
exentric_nova
|
Apr 15 2010, 10:44 PM
|
|
Well if you don't mind JQuery, here it is. CODE $('input:checkbox').click(function() { var target = $(this).val(); if(this.checked == true) { $('#'+target).show(); } if(this.checked == false) { $('#'+target).hide(); } });
This post has been edited by exentric_nova: Apr 15 2010, 10:46 PM
|
|
|
|
|