mardi 3 mars 2015

If checked, show different checkbox

I am in need of building a form, all checkboxes, which show one after another. So if one checkbox is checked, another shows below. Only when the one above is checked. The form will contain hundreds of checkboxes as many options. so Ifelse statements wouldn't be suitable. The data for each checkbox will be parsed from xml file. The only code that seems to stick for this is



$('#chkCheckBox').on('click', function (){

var nextID, body, nextEl;

nextID = $(this).attr(target);
nextEl = $('#' + nextID);

if(nextEl.style.visibility == 'hidden') {
nextEl.style.visibility = 'display'
}

})


Just after a little guidance please. Hope I made sense, feel like I'm going round in circles.


Aucun commentaire:

Enregistrer un commentaire