Setting Focus on Web Form

Having a good user interface is very important for our websites and I have one new website design guideline.

If the user is expected to enter any data, we want to make sure that we set the focus appropriately on the right data field (e.g. text box or check box).

Setting the focus is very easy as well, so there is no good excuse if a website does not implement this feature.

<body onLoad=”document.formName.fieldName.focus();”>
.
.
<form name=”formName” method=”post” action=”/mywebsite/formAction”>
<input name=”fieldName” />
.
.
</form>
.
.
</body

Leave a Reply