stargate
07-18-2003, 07:37 AM
Greetings all....
Ok, to be fair, my experience in Javascript/DHTML is limited to copying and pasting code ...also, my issue may be discussed before, but I am in need for help, any help ...
Simply, there is an ASP code that generates a series of questions from DB table,,,, some of these questions should be displayed/hidden depending on a selection (yes/no) of a certain radio button ...
I found the code that do this , it is working Ok, but the problem is that the place for hidden questions is still reserved , I mean when you hide a form element, it becomes hidden,but white place is placed instead...
is there any method to hide a complete table row and making it as if it is not present?
I tried to place the <Span ... > before the <TR> but didn't work
If not clear , please tell me .. THANKS IN ADVANCE
Used code:
<script type=text/javascript>
// Author: JS-Examples - http://www.js-examples.com
// Courtesy of SimplytheBest.net (http://simplythebest.net/info/dhtml_scripts.html)
// _w : which ID (1) or (2)
// _h : (h)ide or (s)how
function toggleT(_w,_h) {
if (document.all) { // is IE
if (_h=='s') eval("document.all."+_w+".style.visibility='visible';");
if (_h=='h') eval("document.all."+_w+".style.visibility='hidden';");
} else { // is NS?
if (_h=='s') eval("document.layers['"+_w+"'].visibility='show';");
if (_h=='h') eval("document.layers['"+_w+"'].visibility='hide';");
}
}
</script>
<form>
Visible <input name="r1" type="radio" checked value="" onClick="toggleT('divt1','s')">
Hidden <input name="r1" type="radio" value="" onClick="toggleT('divt1','h')">
</form>
<span id="divt1" style="visibility:visible;position:relative;top:0;left:0">
<form>
....
</form>
</span>
Ok, to be fair, my experience in Javascript/DHTML is limited to copying and pasting code ...also, my issue may be discussed before, but I am in need for help, any help ...
Simply, there is an ASP code that generates a series of questions from DB table,,,, some of these questions should be displayed/hidden depending on a selection (yes/no) of a certain radio button ...
I found the code that do this , it is working Ok, but the problem is that the place for hidden questions is still reserved , I mean when you hide a form element, it becomes hidden,but white place is placed instead...
is there any method to hide a complete table row and making it as if it is not present?
I tried to place the <Span ... > before the <TR> but didn't work
If not clear , please tell me .. THANKS IN ADVANCE
Used code:
<script type=text/javascript>
// Author: JS-Examples - http://www.js-examples.com
// Courtesy of SimplytheBest.net (http://simplythebest.net/info/dhtml_scripts.html)
// _w : which ID (1) or (2)
// _h : (h)ide or (s)how
function toggleT(_w,_h) {
if (document.all) { // is IE
if (_h=='s') eval("document.all."+_w+".style.visibility='visible';");
if (_h=='h') eval("document.all."+_w+".style.visibility='hidden';");
} else { // is NS?
if (_h=='s') eval("document.layers['"+_w+"'].visibility='show';");
if (_h=='h') eval("document.layers['"+_w+"'].visibility='hide';");
}
}
</script>
<form>
Visible <input name="r1" type="radio" checked value="" onClick="toggleT('divt1','s')">
Hidden <input name="r1" type="radio" value="" onClick="toggleT('divt1','h')">
</form>
<span id="divt1" style="visibility:visible;position:relative;top:0;left:0">
<form>
....
</form>
</span>