You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chris Norris <th...@gmail.com> on 2005/10/28 15:57:48 UTC

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.