Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JS]Przycisk
Mlodycompany
post
Post #1





Grupa: Zarejestrowani
Postów: 910
Pomógł: 44
Dołączył: 20.02.2008
Skąd: Łódź

Ostrzeżenie: (20%)
X----


Witam. Zaczynam przygodę z JSem no i napotkałem mały problem. Mam taki kod

  1.  
  2. <script type="text/javascript">
  3.  
  4. var f = document.forms["logowanie"];
  5. if(f.login.value == ""){
  6. document.getElementById("submit").disabled = true;
  7. }
  8. else{
  9. document.getElementById("submit").disabled = false;
  10. }
  11. if(f.haslo.value == ""){
  12. document.getElementById("submit").disabled = true;
  13. }
  14. if(f.haslo.value != ""){{
  15. document.getElementById("submit").disabled = false;
  16. }
  17.  
  18.  
  19.  
  20. <form action="" method="post" id="logowanie">
  21. <table width="100%">
  22. <tr>
  23. <th>Logowanie</th>
  24. </tr>
  25. <tr>
  26. <td>Login</td>
  27. </tr>
  28. <tr>
  29. <td><input name="login" type="text"/></td>
  30. </tr>
  31. <tr>
  32. <td>Hasło</td>
  33. </tr>
  34. <tr>
  35. <td><input name="haslo" type="password" /></td>
  36. </tr>
  37. <tr>
  38. <td><input type="submit" value="Zaloguj" id="submit"/></td>
  39. </tr>
  40. </table>
  41. </form>
  42.  
  43.  


Powinno wyłączać przycisk logowania jeżeli dane nie są wpisane, a jednak nie wyłącza. Jak dla mnie wszystko wygląda dobrze, ale ... nie działa. Proszę o pomoc.

Go to the top of the page
+Quote Post

Posty w temacie
- Mlodycompany   [JS]Przycisk   24.09.2009, 18:14:39
- - flashdev   Kodwindow.addEventListener("load", fun...   24.09.2009, 18:45:00


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: 24.12.2025 - 14:53