Welcome to WebmasterWorld Guest from 54.158.51.150

Forum Moderators: open

Message Too Old, No Replies

show/hide div only once

no loop

     
11:07 pm on Sep 12, 2006 (gmt 0)



Hi,

I would like a div (for live comment preview) to be hidden by default, and show on focus of the comment form - that's all.

Notice : If it shows onfocus and hides onblur it's very annoying and if I go to another window the behavior can even be reversed (onfocus = hide).

2:34 pm on Sep 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Forms don't have an onfocus event. Maybe you can attach it to the first input field?

<input type="text"  
onfocus="document.getElementById('myDiv').syle.display='block';">
4:22 am on Sep 14, 2006 (gmt 0)



I can't have it to work.

<style type="text/css">
#show_hide{display:none;}
</style>

<div id="show_hide">
ok
</div>

<input type="text" onfocus="document.getElementById('show_hide').syle.display='block';">

4:32 am on Sep 14, 2006 (gmt 0)



Ah, it's because of your typo.
Well thanks anyway, was easier than I thought, I should learn JS.
4:32 am on Sep 14, 2006 (gmt 0)

10+ Year Member



May just be the misspelled style. Add the 't' to 'syle' and it should work.
5:38 am on Sep 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oops, sorry for he ypo ;)
 

Featured Threads

Hot Threads This Week

Hot Threads This Month