Forum Moderators: open

Message Too Old, No Replies

Select an option - then more options appear

help!

         

Andrew Thomas

10:53 am on Oct 7, 2003 (gmt 0)

10+ Year Member



I have a number of check boxes, with descriptions, once one of these check boxes is selected i want another set of options to be displyed below (without pressing any submit buttons). Im a bit lost on the code required for this in asp. Can anyone give me a piece of sample code for this please for a starting point.

thanks

Alternative Future

11:06 am on Oct 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

Would you be doing this through javascript on the client-side and using the onclick event? Where you would then display some of the other options available from a hidden div tag using the DOM.
If it is use of asp where the page would refresh with the new options then am afraid i cannot help.

-gs

Andrew Thomas

11:10 am on Oct 7, 2003 (gmt 0)

10+ Year Member



Alternative_Future thanks for replying.

I'm not sure how to do it either way, so im open to options

thanks

Alternative Future

11:25 am on Oct 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you are willing to use javascript then it should work like this:

<script language="javascript">
function show(object) {
document.getElementById(object).style.visibility='visible';
}

</script>
<input type="checkbox" name="checkOptions1" onclick="show('checkOptions1')">Opt 1
<input type="checkbox" name="checkOptions2" onclick="show('checkOptions2')">Opt 2

<div id="checkOptions1" style="visibility:hidden">
show checkOptions1
</div>
<div id="checkOptions2" style="visibility:hidden">
show checkOptions2
</div>

Obviously you may wish for it to hide on check off am looking at that just now!

-gs