Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> problem z divem
joytec
post 21.02.2006, 16:49:05
Post #1





Grupa: Zarejestrowani
Postów: 66
Pomógł: 0
Dołączył: 24.06.2005

Ostrzeżenie: (0%)
-----


Kod
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>Untitled Document</title>
<script type="text/javascript">
function ccount(chk, name) {
   var childs = document.getElementById(name).childNodes;
   if(chk.checked){
     for(i = 0; i < childs.length; i++) {
       if(childs[i].type=="checkbox") {
           childs[i].disabled=false;
       }
     }
   }else{
  for(i = 0; i < childs.length; i++) {
       if(childs[i].type=="checkbox") {
           childs[i].disabled=true;
       }
     }
   }
}
</script>

</head>

<body>
<form action="" method="get" name="form1">
<input name="ch1" type="checkbox" value="ch1v" onclick="ccount(this, 114)" />
<div id="114">
<table><tr>
<td><input name="ch2" type="checkbox" disabled value="ch2v" /></td>
<td><input name="ch3" type="checkbox" disabled value="ch3v" /></td>
<td><input name="ch4" type="checkbox" disabled value="ch4v" /></td>
</tr></table>
</div>
</form>
</body>
</html>

Witam.
Funkcja nie dziala po zapisaniu checkboxow w tabele. Dlaczego?. Skrypt po kliknieciu checkboxa aktywizuje reszte lub odwrotnie.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 26.06.2025 - 05:49