Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Formularz, Wymuszenie zaznaczenia pola
Kas
post
Post #1





Grupa: Zarejestrowani
Postów: 425
Pomógł: 0
Dołączył: 28.05.2005
Skąd: Warszawa

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


Robię newsletter w php. I chciałbym aby pole do wpisania adres mail było zablokowane do czasu zaznaczenia pola "Akceptuję regulamin". Po kliknięciu na to pole tekstowe ma być natychmiast odblokowane.
Jak to zrobić? (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)

Ten post edytował Kas 28.06.2005, 19:56:07
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
NoiseMc
post
Post #2





Grupa: Zarejestrowani
Postów: 398
Pomógł: 10
Dołączył: 24.11.2004
Skąd: Łódź

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


  1. <script type="text/javascript" language="javascript">
  2. function wlaczAdres ()
  3. {
  4. if ( document.getElementById ( 'Regulamin' ).checked )
  5. {
  6. document.getElementById ( 'Adres' ).disabled = false;
  7. }
  8. else
  9. {
  10. document.getElementById ( 'Adres' ).disabled = true;
  11. }
  12. }
  13. </head>
  14.  
  15. <form action="zapisz.php" method="post">
  16.  
  17. Adres:
  18. <input type="text" name="Adres" id="Adres" size="12" disabled> <br>
  19.  
  20. Akceptuję <a href="index.php?strona=new_reg">regulamin</a>:
  21. <input type="checkbox" name="Regulamin" id="Regulamin" onClick="wlaczAdres ();"> <br>
  22.  
  23. <input type="submit" value="Zapisz">
  24. </form>
  25. </body>
  26. </html>


Działa pod FF i pod IE
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 14.09.2025 - 14:46