Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> textarea ukryte znaki z php do javy, Jak to zrobić? blad javascriptu wyskakuje.
kondor
post
Post #1





Grupa: Zarejestrowani
Postów: 28
Pomógł: 0
Dołączył: 26.09.2005

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


Witajcie,

Zwykle staram sie sam rozwiązywać problemy ale teraz po prostu wariuję.

Mam formularz którym wysyłam dane do bazy (MySQL). Wszystko ok, także z polem textarea ale do czasu.
Gdy ktoś w textarea użyje "entera" to wysypuje się kod javascript który wyświetla te dane pobrane z bazy.

Używałem wszystkiego - "htmlspecialchars", "nl2br" itd. i nic

kod wywołujący wygląda tak:
  1. onmouseover="showToolTip('xxxxx','<?=($w[pm_z])?>',event);


javascript do tego tak:
  1. var xPos;
  2. var yPos;
  3.  
  4. function showToolTip(title,msg,evt){
  5. if (evt) {
  6. var url = evt.target;
  7. }
  8. else {
  9. evt = window.event;
  10. var url = evt.srcElement;
  11. }
  12. xPos = evt.clientX;
  13. yPos = evt.clientY;
  14.  
  15. var toolTip = document.getElementById("toolTip");
  16. $('#toolTip').html('<h1>'+title+'</h1><p>'+msg+'</p>');
  17. toolTip.style.top = parseInt(yPos)+2 + "px";
  18. toolTip.style.left = parseInt(xPos)+2 + "px";
  19. $('#toolTip').fadeIn(300);
  20.  
  21. }
  22.  
  23. function hideToolTip(){
  24. var toolTip = document.getElementById("toolTip");
  25. $('#toolTip').hide();
  26. }


wg konsoli bledow wysypuje sie w momencie takim:
"
Błąd: unterminated string literal
Wiersz: 1, Kolumna: 24
Kod źródłowy:
showToolTip('xxxx','<strong>xxxx:</strong> 9<br/><strong>xxxx:</strong> 2<br/><strong>xxxx:</strong> 7<br/><strong>Ostatni wpis:</strong><br/>sdsadsadasdasdasd<br />"

Czy ktoś jest mi w stanie pomóc?

Dziękuje smile.gif

pozdrawiam,
Konrad
Go to the top of the page
+Quote Post

Posty w temacie


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: 20.08.2025 - 11:06