Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> INPUT TEXTAREA <<<<< walidacja
magier123
post
Post #1





Grupa: Zarejestrowani
Postów: 80
Pomógł: 0
Dołączył: 27.03.2007

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


Witam!
Nie mam bladego pojecia o javie wiec pytam....
Jak w zwyklym formularzu zrobic tak zeby dopiero po wpisaniu w zwyklym polu input mozna bylo wpisac cos do texarea??
Po prostu po uzupelnieniu input odblokowac textarea.... Dzieki z gory za pomoc
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 8)
tommy4
post
Post #2





Grupa: Zarejestrowani
Postów: 288
Pomógł: 12
Dołączył: 2.12.2005

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


  1. <input id="ftext" (...) onkeyup="if(this.value.length > 0) { document.getElementById('farea').disabled = false; } else { document.getElementById('farea').disabled = true; }" /><textarea id="farea" disabled="disabled" (...)></textarea>


Kod niesprawdzany. (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg) Ale idź w tym kierunku.

zamiast (...) wstaw resztę argumentów ;o

Ten post edytował tommy4 24.08.2007, 20:10:54
Go to the top of the page
+Quote Post
magier123
post
Post #3





Grupa: Zarejestrowani
Postów: 80
Pomógł: 0
Dołączył: 27.03.2007

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


Ok wielkie dzieki wsyztsko dziala..... jeszcze jedno male pytanko.... zeby to zrobic ladniejsze.... co wpisac zeby kiedy pole jest nieaktywne bylo np szare a jak jest aktywne zeby bylo biale?
Go to the top of the page
+Quote Post
jjkk
post
Post #4





Grupa: Zarejestrowani
Postów: 38
Pomógł: 0
Dołączył: 18.05.2006

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


tommy4: przeciez magier123 chcial w javie a nie w javascrypice rozwiazanie:p

magier123: podstawy css...

  1. <style type="text/css">
  2.  
  3. input:hover {background: yellow;}
  4. input:focus {background: #FF99FF;}
  5. input:focus:hover {background: #99FF99;}
  6.  
Go to the top of the page
+Quote Post
magier123
post
Post #5





Grupa: Zarejestrowani
Postów: 80
Pomógł: 0
Dołączył: 27.03.2007

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


YYY albo cos nie tak robie albo cos tu nie dziala.... poza tym cos takiego da sie zrobi chyba w JAVASCRIPT??

Poza tycm chcialbym zeby kolor zmienial sie nie po nacisnieciu pola textarea ale po wypelnieniu pola input.....

Czyli--- pole input puste--textarea szare --- pole input wypelnione---textarea biale




jjkk: bez przesady... podstawy css znam

Ten post edytował magier123 25.08.2007, 12:19:03
Go to the top of the page
+Quote Post
jjkk
post
Post #6





Grupa: Zarejestrowani
Postów: 38
Pomógł: 0
Dołączył: 18.05.2006

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


  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html">
  4. <script type="text/javascript">
  5. var f;
  6. window.onload = function() {
  7. f = document.forms['f'];
  8. f.onkeyup = odblokuj;
  9. }
  10. function odblokuj() {
  11. if(f.i.value.length > 0)
  12. f.t.removeAttribute('disabled');
  13. }
  14. </head>
  15.  
  16. <form name="f">
  17. <input type="text" name="i" value=""><br />
  18. <textarea name="t" disabled="disabled"></textarea>
  19. </form>
  20.  
  21. </body>
  22. </html>
Go to the top of the page
+Quote Post
magier123
post
Post #7





Grupa: Zarejestrowani
Postów: 80
Pomógł: 0
Dołączył: 27.03.2007

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


(IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) ?

Podales mi prawie to samo co tommy4.... gdzie tu jest zmiana kolorow?? To ze firefox zaciemnia nieaktywne pole nie oznacza ze kolor pola sie zmienia... IE np tego nie robi....(IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) ? nie rozumie do czego zmierzasz
Go to the top of the page
+Quote Post
tommy4
post
Post #8





Grupa: Zarejestrowani
Postów: 288
Pomógł: 12
Dołączył: 2.12.2005

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


  1. <script type="text/javascript">
  2. function make_change(th, col1, col2)
  3. {
  4. var textarea = document.getElementById('farea');
  5. if(th.value.length > 0)
  6. {
  7. textarea.disabled = false;
  8. textarea.style.backgroundColor = col1;
  9. }
  10. else
  11. {
  12. textarea.disabled = true;
  13. textarea.style.backgroundColor = col2;
  14. }
  15. }
  16. <input id="ftext" onkeyup="make_change(this, '#FF0000', '#FFFFFF');" /><textarea id="farea" disabled="disabled" style="background-color: #ffffff;"></textarea>
Go to the top of the page
+Quote Post
magier123
post
Post #9





Grupa: Zarejestrowani
Postów: 80
Pomógł: 0
Dołączył: 27.03.2007

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


DOKLADNIE o to chodzilo (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif) Wielkie dzieki........ jestes gosc...
Go to the top of the page
+Quote Post

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.08.2025 - 01:32