I am trying to write a form for a site. The thing i want to do is when a person clicks on a checkbox i want to show to more textbox under it asking for details,after that. If not clicked i want the box to be hidden so that they layout and over all look is not affected
<script type='text/javascript'> function showhidden(){ var obj = document.getElementById('hiddenarea'); if(obj.style.display == 'block'){ obj.style.display = 'none'; }else{ obj.style.display = 'block'; } } </script> <input type="button" value="Show Hide" onclick="showhidden()"/> <div id="hiddenarea" style="display:none"> This is hidden content... </div> HTML: Its not exactly how you want it, but you can play with that