Forum Moderators: open

Message Too Old, No Replies

OnMouseOver once!

         

FnTm

5:44 am on Aug 15, 2007 (gmt 0)

10+ Year Member



Hi all again. I have a problem with a javascript this time.

Is there any way, that I could make onmouseover efect happen just once?

Because now I have a value to my input field, and when I cross my mouse over it, the value changes to nothing(and that is good, because I want it to do that) But when I type something, and cross it over again, it dissapears. Is there any way, to make the script change the value only ONCE?

daveVk

7:01 am on Aug 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In your code that does "value changes to nothing" have it also remove onmouseover handler?

FnTm

7:07 am on Aug 15, 2007 (gmt 0)

10+ Year Member



didnt really understand what you where saying, but here is my code:
<input type="text" id="text" name="text" style="width: 200; height: 70px" lenght="15" value="Comment..." onclick="this.value = '';"><br>

daveVk

7:30 am on Aug 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try

<input type="text" id="text" name="text" style="width: 200; height: 70px" lenght="15" value="Comment..." onclick="this.value = '';this.onclick=null;"><br>

FnTm

7:40 am on Aug 15, 2007 (gmt 0)

10+ Year Member



Thanks man! It WORKS!

But I tried to change the values, for it to work with onmouseover, but it didnt work for me... somehow...

Could you please help me with that code too?

FnTm

8:36 am on Aug 15, 2007 (gmt 0)

10+ Year Member



Made it work :D

Was beeing a mooron and edited a backup I made, instead of file I was wanting to edit :D

Thanks a lot for your help!