Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP][HTML]Max liter w polu textarea
zeetor
post
Post #1





Grupa: Zarejestrowani
Postów: 76
Pomógł: 1
Dołączył: 1.07.2008
Skąd: Poznań

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


Jak wyznaczyc max liter w polu textarea....w polu input robi sie to
maxlength="10"
...ale w polu textarea ta formułka nie dziala...

dz i pozdr
Go to the top of the page
+Quote Post
ayeo
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 1 202
Pomógł: 117
Dołączył: 13.04.2007
Skąd: 127.0.0.1

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


Witam!

  1. <head>
  2. <script language="Javascript">
  3. function tooLong(strTest,maxLength)
  4. {
  5. if(strTest.value.length > maxLength)
  6. {
  7. strTest.value = strTest.value.substr(0,50);
  8. }
  9. }
  10. </script>
  11. </head>
  12. <body>
  13.  
  14. <form>
  15. <textarea name="myText" onChange="tooLong(this,50)"></textarea>
  16. </form>
  17. </body>
  18. </html>


* kod znaleziony w necie

Pozdrawiam!


--------------------
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 19.08.2025 - 19:44