Search Blog Posts

Focusing a specific form field on page load

If you require a form field to be set as the focus when the page loads, we can use the onload function to make this possible.

All you need to do is use the code below and replace the FormName and FormField with your elements names and all should work fine.

<body onload="document.FormName.FormField.focus()">

Tags: ,

Post this story to Delicious Post this story to Digg Post this story to Technorati Post this story to SumbleUpon Post this story to Facebook Post this story to Reedit

Leave a Comment

  1. XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© Copyright 2003-2008 Minimalistic Designs | Terms | Links | Sitemap
Website Design Liskeard - www.minimalistics.co.uk