Well you at least have your form and js set up right now.

And after going back and re-reading your post I see this is ajax. IIRC
in-line javascript in ajax content doesn't automatically fire. Most likely
this is a security thing. So that gives you two options (at least).

1. Wrap your JS code at the bottom of the page in a function and execute the
function when the ajax call completes.
2. Add your focus setting code into a callback function on the ajax call.

Either one will work, it's just a matter of whether or not your caller will
be aware of the form and fieldname you want to focus on.

HTH.

On Sat, Sep 25, 2010 at 10:20 PM, John Pullam <[email protected]>wrote:

>
> Well, it still doesn't work. I've been doing CF for several years myself
> and this one doesn't make a lot of sense. I have tried the various combos
> you are alluding to and the code now is:
>
> <cfform name="LoginForm">
>         <table id="LoginBox">
>        <tr height="21">
>                <td width="100"><b>Access ID</b></td>
>                <td width="100"><cfinput name="AccessID" validate="range"
> range="1000,4999" value="#DefAccessID#" size="8"
>                        required="yes" message="A valid Access ID is
> required" /></td>
>                </tr>
>        <tr height="21">
>                <td><b>Password</b></td>
>                <td><cfinput name="Password" type="password"
> value="#DefPassword#" size="8" required="Yes"
>                        message="A password is required" /></td>
>                </tr>
>        <tr height="21">
>                <td colspan="2"><span class="fineprint">Remember me on this
> computer</span>
>                        <cfset checked=IIf(DefRemember EQ
> "Yes","'checked'","''")>
>                        <input type="checkbox" name="Remember" value="Yes"
> #checked#></td>
>                </tr>
>        </table>
>        <cfinput name="Submit" type="image" value="Submit"
> src="../Buttons/MSubmit.png"  />
>  </cfform>
>  <script>
> document.LoginForm.AccessID.focus();
> </script>
>
> It feels to me as though the JS can't find document.LoginForm.AccessID.
> Firebug freezes on that line but I'm not getting a clean error message.
>
> Is it possible that there is some new trick needed in CF 9?
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337558
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to