Connecting Tech Pros Worldwide Help | Site Map

focus()

  #1  
Old July 20th, 2005, 12:03 PM
Philip WATTS
Guest
 
Posts: n/a
I have written a function that checks the format of the text entered into a
form field. The function is called by an onBlur() event and checks the
format of the script which, if it is incorrect calls a second function to
display an alert() message. Both functions end with a return statement.

My problem is that the cursor returns to the following form field, and not
the one that I have just checked. I assume this is because my function is
called on a "onBlur()" event and so the return will send the cursor/script
to the next item, my next form field.

Is there a way of placing the focus to the field that I want?

Thanks


  #2  
Old July 20th, 2005, 12:04 PM
Hywel Jenkins
Guest
 
Posts: n/a

re: focus()


In article <bm6ude$mre$1@newsg1.svr.pol.co.uk>,
PRWATTS@syringa.freeserve.co.uk says...[color=blue]
> I have written a function that checks the format of the text entered into a
> form field. The function is called by an onBlur() event and checks the
> format of the script which, if it is incorrect calls a second function to
> display an alert() message. Both functions end with a return statement.
>
> My problem is that the cursor returns to the following form field, and not
> the one that I have just checked. I assume this is because my function is
> called on a "onBlur()" event and so the return will send the cursor/script
> to the next item, my next form field.
>
> Is there a way of placing the focus to the field that I want?[/color]

document.FormName.FieldName.focus();

--
Hywel I do not eat quiche
http://hyweljenkins.co.uk/
http://hyweljenkins.co.uk/mfaq.php
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
this.window.focus() vs. window.focus() vs. this.focus() Roger answers 4 March 9th, 2007 03:55 AM
popup focus() behaviour with moz, firefox, ie Alex.Svetos@gmail.com answers 11 April 28th, 2006 06:05 AM
.Focus problem..urgent.. avnrao answers 1 November 18th, 2005 12:42 PM
Returning Focus to Main Form Neil Ginsberg answers 17 November 13th, 2005 08:22 AM
Problem with Focus... Help needed. Nitin answers 4 July 23rd, 2005 02:06 PM