![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 202 Pomógł: 3 Dołączył: 6.01.2008 Skąd: Mazowieckie Ostrzeżenie: (0%) ![]() ![]() |
Witam, posiadam skrypt rejestracji lecz potrzebuje go jeszcze rozbudować (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) . Stanąłem na checkboxie, ponieważ nie wiem jak uzyskać taki efekt, żeby po jego zaznaczeniu pojawiły się kolejne pola do wypełnienia (lub były szare /niedostępne/, a dopiero po zaznaczeniu checkoboxa stawały się /dostępne/). Udało mi się stworzyć coś takiego co działa nie do końca poprawnie.., tzn:
po zaznaczeniu checkboxa pojawia sie pod nim napis "cos" (- to jest ok) ale obok niego nie wyświetla się pole do wpisywania danych //czy może Ktoś wie co robie nie tak? Probowałem zabawy z <div> ale tez jest zle.. Kod <html> <head> <script type="text/javascript"> function showDiv(){ var checkBox = document.getElementById('a'); var oDiv = document.getElementById('b'); if(checkBox.checked == true){ oDiv.style.display = 'block'; } else if(checkBox.checked == false){ oDiv.style.display = 'none'; } } </script> </head> <body> <div id="top"> <div id="NAGLOWEK">naglowek</div> <div id="FORM_REJ"> <h2> Wprowadz dane </h2> <form action="form_rej.php" method="POST"> <table border="0"> <tr><td>imię</td><td> <input type="text" name="imie" maxlenght="30" size="30"></td></tr> <tr><td>nazwisko</td><td> <input type="text" name="nazwisko" maxlenght="30" size="30"></td></tr> <tr><td>login</td><td> <input type="text" name="login" maxlenght="30" size="30"></td></tr> <tr><td>hasło</td><td> <input type="password" name="haslo" maxlenght="30" size="30"></td></tr> <tr><td>powtórz hasło</td><td> <input type="password" name="haslo2" maxlenght="30" size="30"></td></tr> <tr><td>email</td><td> <input type="text" name="email" maxlenght="30" size="30"></td></tr> <tr><td><input type="checkbox" name="a" id="a" onClick="showDiv()"> firma </td><td></td></tr> <tr><td><div id="b" style="display:none;">cos</div></td><td><div id="b" style="display:none;">vods</div> </td></tr> <tr><td>regon</td><td> <input type="text" name="regon" maxlenght="30" size="30"></td></tr> <tr><td colspan="2"> <input type="submit" value="dodaj" name="send"> </table> </form> </body> </html> dałem rade samemu (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif) , przerobiłem tabele na divy, trochę pozmieniałem i się udało.. Ten post edytował em-ba 27.01.2008, 21:54:27 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 18.09.2025 - 06:42 |