Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript]Odliczanie + button
dk1342
post
Post #1





Grupa: Zarejestrowani
Postów: 275
Pomógł: 9
Dołączył: 24.07.2008
Skąd: Racibórz

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


Temat do usunięcia

Ten post edytował dk1342 20.10.2008, 14:26:55
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
drPayton
post
Post #2





Grupa: Zarejestrowani
Postów: 890
Pomógł: 65
Dołączył: 13.11.2005
Skąd: Olsztyn

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


Ale koszmarek...
Nawet testować się nie chce... A może to dlatego, że kodu a tagi nie ubrałeś? (IMG:http://forum.php.pl/style_emoticons/default/rolleyes.gif)

  1. <input type="submit" id="ID_buttonu" value="Submit za 10 sekund..." />
  2.  
  3. <script type="text/javascript">
  4. document.getElementById("ID_buttonu").disabled = true;
  5. var counter = 10;
  6. function countdown(counter) {
  7. counter--;
  8. document.getElementById("ID_buttonu").value = 'Submit za ' + counter + ' sekund';
  9. if(counter == 0) {
  10. document.getElementById("ID_buttonu").disabled = false;
  11. document.getElementById("ID_buttonu").value = 'Submit!';
  12. }
  13. return counter;
  14. }
  15. setInterval('counter = parseInt(counter); if(counter > 0) { counter = countdown(counter); }', 1000);


Ten post edytował drPayton 15.10.2008, 19:46:51
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: 12.10.2025 - 02:36