Skip to Content

body onLoad() and all that fun

As a part of my present gig I have developed an employee search portal application based on htmlb. In one of its form there is a simple htmlb form with a single text field for the query. User can put any attribute related to an employee in this field and the application does the search and returns result. Pretty simple.   Usability guys say that when user visits a page on the internet with a html form on it, it’s default text field should have a focus so that user doesn’t need to make a click. How do you do that in normal world, write a body onload function which calls a javascript to set proper focus. But how do get body tag in htmlb content or page tags. So I ended up putting a 1×1 image in the htmlb form which while loading calls a javascript to put focus in the required text field. And since the ids for these htmlb text fields are auto generated by runtime, capturing these ids is also some more fun. This article at SDN was great help.
1 Comment
You must be Logged on to comment or reply to a post.
  • If i’m not wrong..we have the onLoad attribute in the ‘htmlb title’ element..In fact I had the same situation of calling a javascript function which would do some client side processing..I have effectivly used OnLoad..