NYCPHP Meetup

NYPHP.org

[nycphp-talk] HTML/CSS div hide/show form problem

Kenneth Downs ken at secdat.com
Thu Jan 4 12:44:19 EST 2007


Cliff,

Can you simply set the focus of a control when the display is turned off 
or on?



Cliff Hirsch wrote:
>
> Ok, so this isn't PHP, but it's what drives us PHP programmers' crazy 
> right -- "quirks" mode, browser incompatibilities, etc. It's maddening...
>
>  
>
> I asked my Boston PHP buddies if they can figure this one out. Let's 
> see who can provide an answer first: Yankees or Red Sox:
>
> ------
>
> I have a form that can be toggled to be visible or hidden using the 
> following statement:
>
>  
>
> <div id="inviteform" style="display:none;">
>
>    the form.....
>
> </div>
>
>  
>
> The form is initially set to be hidden. A simple JavaScript function 
> toggles the div display property to nothing/block or none.
>
>  
>
> Problem:
>
> Without this code, the cursor appears normally in the input elements
>
> With this code, the cursor disappears in the input elements. It's 
> awfully annoying to type text in an input element without the visual 
> cue of a cursor.
>
>  
>
> This occurs in FireFox, but not IE.
>
>  
>
> Does anyone know why the cursor is disappearing? I'm guessing that the 
> input element cursor attribute picks up the none property (as in 
> cascading) when hidden, but does not revert back to visible when the 
> div display element is changed back to '' or block.
>
>  
>
> Any ideas regarding a solution?
>
>  
>
> Cliff
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20070104/1c898758/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ken.vcf
Type: text/x-vcard
Size: 261 bytes
Desc: not available
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20070104/1c898758/attachment.vcf>


More information about the talk mailing list