Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [HTML][PHP]Apostrof w kodzie
Efan
post 25.04.2010, 21:45:37
Post #1





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

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


Mam formularz kontaktowy który wyświetlany jest w echo. Tu pojawia się problem apostrofów. Proszę o pomoc.

  1. <input name="email" type="text" value="Adres e-mail" onfocus="if(this.value=='' || this.value == 'Adres e-mail') this.value=''" onblur="if(this.value == '') {this.value=this.defaultValue}" onkeyup="keyUp();">
  2. ';
Go to the top of the page
+Quote Post
XDocTorX
post 25.04.2010, 21:48:14
Post #2





Grupa: Zarejestrowani
Postów: 48
Pomógł: 6
Dołączył: 16.07.2006
Skąd: Jarosław

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


Powinno być ok.

  1. echo '
  2. <input name="email" type="text" value="Adres e-mail" onfocus="if(this.value==\'\' || this.value == \'Adres e-mail\') this.value=''" onblur="if(this.value == '') {this.value=this.defaultValue}" onkeyup="keyUp();">
  3. ';
Go to the top of the page
+Quote Post
cros
post 25.04.2010, 21:59:15
Post #3





Grupa: Zarejestrowani
Postów: 164
Pomógł: 21
Dołączył: 21.08.2009

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


Cytat(XDocTorX @ 25.04.2010, 22:48:14 ) *
Powinno być ok.

  1. echo '
  2. <input name="email" type="text" value="Adres e-mail" onfocus="if(this.value==\'\' || this.value == \'Adres e-mail\') this.value=''" onblur="if(this.value == '') {this.value=this.defaultValue}" onkeyup="keyUp();">
  3. ';


jeszcze tutaj
  1. this.value=\'\'" onblur="if(this.value == \'\')';

a nie lepiej tak?
  1. ?>
  2. <input name="email" type="text" value="Adres e-mail" onfocus="if(this.value=='' || this.value == 'Adres e-mail') this.value=''" onblur="if(this.value == '') {this.value=this.defaultValue}" onkeyup="keyUp();">
  3. <?

Bardziej przejrzyste..
Go to the top of the page
+Quote Post
Efan
post 25.04.2010, 22:08:09
Post #4





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

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


Wielkie dzięki. W między czasie spróbowałem z czymś takim i też działa.

  1. $input_email = "if(this.value=='' || this.value == 'Adres e-mail') this.value=''";
  2. $input = "if(this.value == '') {this.value=this.defaultValue}";
  3.  
  4. <input name="email" type="text" value="Adres e-mail" onfocus="'.$input_email.'" onblur="'.$input.'" onkeyup="keyUp();">
  5. ';
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 Wersja Lo-Fi Aktualny czas: 1.05.2024 - 13:15