![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 5 Pomógł: 0 Dołączył: 21.03.2004 Skąd: Chodziez Ostrzeżenie: (0%) ![]() ![]() |
potrzebuje licznik ktory pokazwyal by ile znakow zostalo do wpisania w <textarea> ma ktos moze taki skrypt?
|
|
|
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 581 Pomógł: 0 Dołączył: 21.07.2003 Skąd: Jasło Ostrzeżenie: (0%) ![]() ![]() |
http://forum.php.pl/viewtopic.php?t=13979 zobacz tam Teodor napisal taki skrypt.......
|
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 5 Pomógł: 0 Dołączył: 21.03.2004 Skąd: Chodziez Ostrzeżenie: (0%) ![]() ![]() |
nie czaje nic z js
moglbys mi wkleic kod odpowiadajacy za samo liczenie bo tam chyba jest zmieszane z czyms (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) |
|
|
![]()
Post
#4
|
|
Grupa: Zarejestrowani Postów: 581 Pomógł: 0 Dołączył: 21.07.2003 Skąd: Jasło Ostrzeżenie: (0%) ![]() ![]() |
Wklej sobie go do dokumentu html i popatrz jak to dziala przeciez chcesz zeby pokazywalo w textarea ile zostalo miejsc:
[xml:1:1a5fd93c3d]<?xml version="1.0" encoding="iso-8859-2"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl"> <head> <title>title</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" /> <script type="text/javascript"> //<![CDATA[ maxchars = 50; function LoadVar() { s1 = document.getElementById('charsleft'); s1.innerHTML = maxchars; } function Popraw1() { t1 = document.getElementById('textar1'); t2 = document.getElementById('textar2'); s1 = document.getElementById('charsleft'); if (t1.value.length < maxchars) { t2.value = t1.value; } else{ t2.value = t1.value; t2.disabled = false; t1.disabled = true; t2.focus(); } s1.innerHTML = maxchars - t1.value.length; } function Popraw2() { t1 = document.getElementById('textar1'); t2 = document.getElementById('textar2'); s1 = document.getElementById('charsleft'); if (t2.value.length < maxchars) { t1.value = t2.value; t1.disabled = false; t2.disabled = true; t1.focus(); } s1.innerHTML = maxchars - t1.value.length; } //]]> </script> </head> <body onload="LoadVar()"> <p>Zostało <span id="charsleft"></span> znaków.</p> <div> <textarea onkeyup="Popraw1()" onchange="Popraw1()" rows="5" cols="50" id="textar1"> </textarea> </div> </body> </html> [/xml:1:1a5fd93c3d] a co tam mi szkodzi :/ |
|
|
![]() ![]() |
![]() |
Aktualny czas: 26.09.2025 - 08:01 |