input onfocus problem
Posted
by Syom
on Stack Overflow
See other posts from Stack Overflow
or by Syom
Published on 2010-04-07T20:38:45Z
Indexed on
2010/04/07
20:43 UTC
Read the original article
Hit count: 540
it is the problem, i can't undertand anyway. i have the following simple script
<input class="input" type="text" name="l_username" style="color: #ccc;"
value= " <?if ($_POST[l_username] != '')
echo $_POST[l_username];
else echo 'something';?>"
onfocus="if (this.value == 'something') {
this.value='';this.style.color='black';}" />
onfocus doesn't work here, but when i delete php script from value, it works
<input class="input" type="text" name="l_username" style="color: #ccc;"
value= " something"
onfocus="if (this.value == 'something') {
this.value='';this.style.color='black';}" />
it works fine. could you tell me why? thanks
© Stack Overflow or respective owner