472,133 Members | 1,090 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,133 software developers and data experts.

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 97311
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.