Hi,

I've had the very same problem recently. Yes, the display:none - DIV does
matter. In my case, I had a form that was initially invisible to have less
clutter on the page.

My current workaround is to set the form to display:none in javascript
instead of CSS on loading in a custom script's initialization-part only
after the focus is set. You have to put the @Script after the @Form to
accomplish this. A minor drawback is, that you can have a bit of flicker on
page-loading, when your invisible parts are displayed for a fraction of a
second

hth,
Marcus

> -----Original Message-----
> From: Chris Norris [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 28, 2005 3:58 PM
> To: Tapestry users
> Subject: focus problems in forms
> 
> 
> When I have a form with only check boxes and submit buttons, 
> IE reports
> javascript errors because the focus is trying to be set to a 
> control that is
> invisable, disabled, or cannot accept focus. The thing is, 
> it's trying to
> set the focus to a checkbox. The checkbox looks like this in 
> rendered html:
> 
> <input type="checkbox" name="Checkbox" id="Checkbox"
> class="normalCheckBox"/> Create ....blahblahblah
> 
> The script at the bottom of the html looks like so:
> 
> <script language="JavaScript" type="text/javascript"><!--
> Tapestry.register_form('formThing');
> Tapestry.set_focus('Checkbox');
> // --></script></body>
> 
> This makes no sense to me. Shouldn't I be able to focus on 
> the checkbox? I
> could set focus to false for the form, but that's not really the best
> solution here. The only odd thing about the checkbox is that 
> it's initiall
> in a div that is hidden like so:
> 
> <div id="someDivId" style="display: none;">
> 
> I wouldn't think that would matter, though. This works fine in FF.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to