Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [js]textareay
kubatron
post
Post #1





Grupa: Zarejestrowani
Postów: 581
Pomógł: 0
Dołączył: 21.07.2003
Skąd: Jasło

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


Witam pisze skrypt newsów i mam takie pytanie czy da sie zrobic 2 text areay i jak pisze w jednej to w drugiej pisze sie to samo i w pierwszej jest ograniczenie do np. 240znaków po wykorzystaniu sie 240 znakow przenosi mnie do drugiej i pisze w drugiej :wink:

Z góry byłbym wdzieczny
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Wankster
post
Post #2





Grupa: Zarejestrowani
Postów: 208
Pomógł: 0
Dołączył: 19.04.2003

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


Kod
<?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>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />

    

    <title>php.pl</title>

    

    <style type="text/css">

    <!--

    

  textarea

  {

     width: 400px;

     border: 2px solid #000;

  }

    

    //-->

    </style>

    

    <script type="text/javascript">

    <!--

    

  function GEBI( elementId )

  {

     return document.getElementById( elementId ) ? document.getElementById( elementId ) : false;

  }

  

  function manageKeys()

  {

     pressed = String.fromCharCode( window.event.keyCode );

    

     if ( ( GEBI('short' ).value.length + 1 ) > 240 )

     {

    if ( GEBI( 'full' ).createTextRange )

    {

        range = GEBI( 'full' ).createTextRange();

       

        range.moveStart( 'character', GEBI( 'full' ).value.length );

        range.collapse();

        range.select();

    }

     }

     else

     {

    GEBI( 'full' ).value += pressed;

     }

    

     return false;

  }

    

    //-->

    </script>

</head>



<body xml:lang="pl">

    <form method="post" action="">

  Wstep:

  <br />

  <textarea id="short" name="short" rows="5" onkeypress="manageKeys();"></textarea>

  <br />

  Pełna tresc:

  <br />

  <textarea id="full" name="full" rows="10"></textarea>

    </form>

</body>

</html>
Only for IE6x
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: 2.10.2025 - 18:24