Re: onBlur and onFocus

by Christopher Higgs <c.higgs(at)landfood.unimelb.edu.au>

 Date:  Wed, 22 Sep 1999 11:08:02 +1000
 To:  Frani Ciesielski <franic(at)qis.net>,
hwg-basics(at)mail.hwg.org
 References: 
  todo: View Thread, Original
At 23:35 20/09/99 -0400, Frani Ciesielski wrote:
>Second, could someone point me to a page that would explain the onBlur and
>onFocus (or other form event handlers)?  

I'm sure you've went to a site with a form to be filled out and you
actually had to click in the little box first, before you could begin
typing (Altavista for example).  Using the focus command, you could
automatically place the cursor inside the text box ready for typing - more
user-friendly to your audience.

The onFocus and onBlur refer to _changes_ in the active form elements.

So I could use onBlur to find out when the person moves the cursor from
that first box - perhaps I want to validate their entry and stop them
proceding until a valid answer has been submitted.  Perhaps I want to
ensure the complete the form in the order _I_ want them to answer.  (When
forms and tables are mixed together, the order of progression is dependent
on individual browsers)

The onFocus command would activate when I click inside (or on) a form
field. Perhaps there is a field I don't want them to change directly, but
whose value is calculated from other fields.  I could use the onFocus
this.blur to force activity away from that box.

HTH

Chris Higgs <c.higgs(at)landfood.unimelb.edu.au>
Institute of Land and Food Resources
University of Melbourne
http://www.landfood.unimelb.edu.au

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA