Tuesday, October 02, 2007

IBD - Request for Help

Page Layout Form InsertWell, the Dashboard has been coming along nicely, and I'm starting to get into some of the more nitty gritty of the site. One of the things that has been bugging me, is finding a way to place the cursor into the first form control when a page opens. Now, I'm more than familiar on how to add the necessary javascript code to the body_onload event, however, my situation has prevented me from putting this practice in place. That's where I hope you can help.

As you see in my diagram, I have the header & footer of every page created as a separate include file. This saves me considerable time & energy when making template or layout changes. This also means that the body tag is contained within the Header file. Now, I toyed with just applying a javascript to this body tag regardless, and if a form exists the cursor would move accordingly. An additional layer of complexity is added with each form & first control using a different name or ID based on the control contents.

So my web mavens, have any of you run into a similar situation? And if you have, how have you gotten around it? Is it just a matter of calling a universal javascript function, that can determine the first control on it's own? I'd love to provide an enhanced user experience with moving the cursor to the first field, but so far I'm stymied. My online searches have proved fruitless.

Your assistance is valued & appreciated. Thank you.

1 comment:

Ben said...

Thanks to jsfreire and soprano, I got my question answered, and the new form insert function working.

I'll explain the solution in a future post.