Warning: Parameter 1 to wp_default_scripts() expected to be a reference, value given in /home/forge/masseltech.com/wp-includes/plugin.php on line 600

Cause a field to be auto-focused when the page is done loading

So, wouldn’t it be user friendly, if when you went to a form page in a document, if the cursor was automagically positioned at the first field in the form?

Why, yes it would. Try:

	
Event.observe(window, 'load', function(){
     try {
          $('eventName').focus();
     } 

     catch (e) {}
});

after your </form> tag. This requires the prototype javascript library


Leave a Reply