U
UKuser
Hi,
The following script:
function isTick(id){
if (document.getElementById(id).checked == true){
alert(id+" is ticked");
}
}
Very simple sample script just to check that the box is ticked.
It WORKS where it is featured here:
</head>
<body>
<form action="">
<p><input type="checkbox" onclick="checkAll('a',4,this.id);"
id="Europe">Europe <span onclick="ShowHideLayer(156);">[Show/Hide]</
span></p>
<div id="box156" class="collapsible">
This layer is now visible and it moves content down the page with
it!<br>
a1: <input type="checkbox" id="a1" onclick="checkStatus(this.id,
4,'Europe');isTick(this.id);"><br>
however it FAILS when it is featured here:
<form action="">
<div class="mainDiv" title="0">
<input type="checkbox" onclick="checkAll('a',4,this.id);"
id="Europe">Europe
<div class="topItem">
<span onmouseover="Init(this.parentNode);">[Show/Hide]</span>
</div>
<div style="height: 0pt;" class="dropMenu">
<div class="subMenu" title="0">
a1: <input type="checkbox" id="a1" value="yes"
onclick="checkStatus(this.id,4,'Europe');isTick(this.id);"><br>
My Q is therefore why is getElementbyID not picking up the checked
status in the second example, only the first?
Thanks and have a good weekend.
A
The following script:
function isTick(id){
if (document.getElementById(id).checked == true){
alert(id+" is ticked");
}
}
Very simple sample script just to check that the box is ticked.
It WORKS where it is featured here:
</head>
<body>
<form action="">
<p><input type="checkbox" onclick="checkAll('a',4,this.id);"
id="Europe">Europe <span onclick="ShowHideLayer(156);">[Show/Hide]</
span></p>
<div id="box156" class="collapsible">
This layer is now visible and it moves content down the page with
it!<br>
a1: <input type="checkbox" id="a1" onclick="checkStatus(this.id,
4,'Europe');isTick(this.id);"><br>
however it FAILS when it is featured here:
<form action="">
<div class="mainDiv" title="0">
<input type="checkbox" onclick="checkAll('a',4,this.id);"
id="Europe">Europe
<div class="topItem">
<span onmouseover="Init(this.parentNode);">[Show/Hide]</span>
</div>
<div style="height: 0pt;" class="dropMenu">
<div class="subMenu" title="0">
a1: <input type="checkbox" id="a1" value="yes"
onclick="checkStatus(this.id,4,'Europe');isTick(this.id);"><br>
My Q is therefore why is getElementbyID not picking up the checked
status in the second example, only the first?
Thanks and have a good weekend.
A