Będę wdzięczny za każdą pomoc..
oto skrypt zamieszczony w <head>
Kod
<script type="text/javascript">
function showDiv(){
var checkBox = document.getElementById('osobaprywatna');
var oDiv = document.getElementById('a');
if(checkBox.checked == true){
oDiv.style.display = 'block';
}
else if(checkBox.checked == false){
oDiv.style.display = 'none';
}
}
</script>
<script type="text/javascript">
function showDiv(){
var checkBox = document.getElementById('firma');
var oDiv = document.getElementById('b');
if(checkBox.checked == true){
oDiv.style.display = 'block';
}
else if(checkBox.checked == false){
oDiv.style.display = 'none';
}
}
</script>
function showDiv(){
var checkBox = document.getElementById('osobaprywatna');
var oDiv = document.getElementById('a');
if(checkBox.checked == true){
oDiv.style.display = 'block';
}
else if(checkBox.checked == false){
oDiv.style.display = 'none';
}
}
</script>
<script type="text/javascript">
function showDiv(){
var checkBox = document.getElementById('firma');
var oDiv = document.getElementById('b');
if(checkBox.checked == true){
oDiv.style.display = 'block';
}
else if(checkBox.checked == false){
oDiv.style.display = 'none';
}
}
</script>
a, no i sekcja <body>
<?php <div id="top"> <div id="NAGLOWEK">naglowek</div> <div id="FORM_REJ"> <form action="form_rej.php" method="POST"> <fieldset> <legend>Wprowadz dane:</legend> <div> <label for="osobaprywatna">osoba prywatna</label> <input id="osobaprywatna" name="osobaprywatna" class="check" type="checkbox" onClick="showDiv()"/>  dane osoby <div id="a" style="display:none;"> <div> <div> <label for="imie">imię</label> <input id="imie" name="imie" class="text" type="text" /> </div> <div> <label for="nazwisko">nazwisko</label> <input id="nazwisko" name="nazwisko" class="text" type="text" /> </div> <div> <label for="haslo">hasło</label> <input id="haslo" name="haslo" class="password" type="password" /> </div> <div> <label for="haslo">powtórz hasło</label> <input id="haslo" name="haslo2" class="password" type="password" /> </div> <div> <label for="email">e-mail</label> <input id="email" name="email" class="text" type="text" /> </div> <div> <label for="regon">regon</label> <input id="regon" name="regon" class="text" type="text" /> </div> <div> <input id="submit" name="send" class="submit" type="submit" value="dodaj" /> </div> </div> </div> </div> <div> <label for="firma">firma</label> <input id="firma" name="firma" class="check" type="checkbox" onClick="showDiv()"/>  dane firmy <div id="b" style="display:none;"> <div> <div> <label for="imie">imię</label> <input id="imie" name="imie" class="text" type="text" /> </div> <div> <label for="nazwisko">nazwisko</label> <input id="nazwisko" name="nazwisko" class="text" type="text" /> </div> <div> <label for="haslo">hasło</label> <input id="haslo" name="haslo" class="password" type="password" /> </div> <div> <label for="haslo">powtórz hasło</label> <input id="haslo" name="haslo2" class="password" type="password" /> </div> <div> <label for="email">e-mail</label> <input id="email" name="email" class="text" type="text" /> </div> <div> <label for="regon">regon</label> <input id="regon" name="regon" class="text" type="text" /> </div> <div> <input id="submit" name="send" class="submit" type="submit" value="dodaj" /> </div> </div> </div> </div> </fieldset> </form> ?>