Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 179
  • Last Modified:

visible and hidden on table row and table data

i have looked at a similar answer in the EE.
I am using php to generate the html, but have included only the html
I am also using Javascript to show/hide the table for.
Basically if the checkbox is clicked the table row and it's td's become visible

Should i look at learning how to us getElementById of can i stick to the current track?

Here's a view of what i am working on...

<html>
<head>
<script type='text/javascript'>
function BeVisible()
{
  document.irbform.Qfive.style.visibility='visible';
}
</script>
</head>
<body>
<!-- input is checkbox button -->
<form name='theForm'id='theForm'>
<input id='riderz' type='checkbox' name='riderz' value='other'  onClick=BeVisible()>&nbsp;7.&nbsp;Other - please specify<br />

<table>
<tr name='Qfive' id='Qfive' style='visibility:hidden;'>
<td>7.&nbsp;Other - please specify</td>
<td><input id='other' type='radio' name='other' value='suitable'  checked></td>
<td><input id='other' type='radio' name='other' value='inadequate' ></td>
<td><input id='other' type='radio' name='other' value='tooMuch' ></td>
</tr>
</table>
</form>

0
ianDunq
Asked:
ianDunq
  • 2
1 Solution
 
sajuksCommented:
//check this. and yes use getElementById for crossbrowser compatibilty
<html>
<head>
<script type='text/javascript'>



function BeVisible()
{
var elem = document.getElementById("Qfive");
elem.style.display = (elem.style.display == "none")?"":"none";

}
</script>
</head>
<body>
<!-- input is checkbox button -->
<form name='theForm'id='theForm'>
<input id='riderz' type='checkbox' name='riderz' value='other'  onClick=BeVisible()>&nbsp;7.&nbsp;Other - please specify<br />

<table>
<tr id='Qfive' style='display:none;'>
<td >7.&nbsp;Other - please specify</td>
<td ><input id='other' type='radio' name='other' value='suitable'  checked></td>
<td ><input id='other' type='radio' name='other' value='inadequate' ></td>
<td ><input id='other' type='radio' name='other' value='tooMuch' ></td>
</tr>
</table>
</form>
0
 
ianDunqAuthor Commented:
Yep that does the trick. Cheers.
0
 
sajuksCommented:
Thanks for the points and grade
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now