How to span elements using JavaScript for a Boolean variable?

nbn8

New Member
I have the following html code and I new to change it so instead of going through all the available check boxes it will only verify if the check box is check then it will display elements (make them visible)\[code\]<div class="default" valign="top"> {Please select check box if you want to creat an Investigation for this Incident:} { } { } { }<field name="BoolfieldonForm" changefunction="OpenInvestigation($(this))"/></div><script type="text/javascript"> $(function () $LB$ OpenInvestigation(null); $RB$); function OpenInvestigation(el) $LB$ var checkBoxes = $('span#span_element_38547 input$LSB$type=checkbox$RSB$'); for (var i = 0, length = checkBoxes.length; i < length; i++) $LB$ ShowHideForm($(checkBoxes$LSB$i$RSB$), false); $RB$ checkBoxes = $('span#span_element_38547 input$LSB$type=checkbox$RSB$:checked'); for (var i = 0, length = checkBoxes.length; i < length; i++) $LB$ ShowHideForm($(checkBoxes$LSB$i$RSB$), true); $RB$ $RB$ function ShowHideForm(el, checked) $LB$ var items = null; switch ($('label$LSB$for="' + el.attr('id') + '"$RSB$').text().toLowerCase()) $LB$ case 'please select chechbox if you want to creat an investigation for this incident:': items = $('span#span_element_38555, span#span_element_38556, span#span_element_38546, span#span_element_38614, span#span_element_38557, span#span_element_38558, span#span_element_38613, span#span_element_38562, span#span_element_38584, span#span_element_38563, span#span_element_38615, span#span_element_38618'); break; $RB$ if (items != null && items.length > 0) $LB$ if (checked) items.show(); else items.hide(); $RB$ $RB$ </script>\[/code\]
 
Back
Top