HTML and JAVASCRIPT

I'm not really sure where to post Javascript questions so i decided to place it here.. Sorry if this is wrong.. ^_^

Anyway,

The web page I'm doing has this certain button that should hide or show certain Table rows..

The problem is that it uses checkboxes (html) and i cant seem to find the Javascript code that will allow me to know whether the Check box is checked or not.

If it isn't checked then it won't show the Row.. if it is then it will

I know this is simple but I'm kinda new to Javascript.

Thanks in advance!

-ArchBytes

[585 byte] By [Arch_Bytesa] at [2007-11-27 3:56:17]
# 1
> I'm not really sure where to post Javascript questions How about a Javascript forum, because Java has nothing at all to do with it (Java and Javascript mostly share four letters, but that's all)?
CeciNEstPasUnProgrammeura at 2007-7-12 9:00:29 > top of Java-index,Java Essentials,Java Programming...
# 2
Try JavaRanch. I posted a link a few hours ago: http://forum.java.sun.com/thread.jspa?threadID=5170850
pbrockway2a at 2007-7-12 9:00:29 > top of Java-index,Java Essentials,Java Programming...
# 3
thanks! sorry for disturbing you guys!
Arch_Bytesa at 2007-7-12 9:00:29 > top of Java-index,Java Essentials,Java Programming...
# 4

This is not the place to do it but anyway, the checkbox object exposes a property called 'checked' which will be true or false.

<html>

<head>

<script>

function showCheckedStatus( checkBox )

{

if ( checkBox.checked == true )

alert("Checkbox is checked");

else

alert("Checkbox is not checked");

}

</script>

</head>

<body>

<form>

<table border="1px" >

<tr>

<td>

<input type="checkbox" name="checkboxes" id="checkbox1" onclick="showCheckedStatus(this);"/>

</td>

<td>

<label>Checkbox 1</label>

</td>

</tr>

</table>

</form>

</body>

</html>

nogoodatcodinga at 2007-7-12 9:00:29 > top of Java-index,Java Essentials,Java Programming...
# 5
Thanks that helped a lot...^_^
Arch_Bytesa at 2007-7-12 9:00:29 > top of Java-index,Java Essentials,Java Programming...