469,328 Members | 1,324 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,328 developers. It's quick & easy.

focus()

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
Jul 20 '05 #1
1 97246
In article <bm**********@newsg1.svr.pol.co.uk>,
PR*****@syringa.freeserve.co.uk says...
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?


document.FormName.FieldName.focus();

--
Hywel I do not eat quiche
http://hyweljenkins.co.uk/
http://hyweljenkins.co.uk/mfaq.php
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Nitin | last post: by
3 posts views Thread by VA | last post: by
17 posts views Thread by Neil Ginsberg | last post: by
1 post views Thread by avnrao | last post: by
11 posts views Thread by Alex.Svetos | last post: by
7 posts views Thread by Dave Booker | last post: by
3 posts views Thread by jp2express | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.