Connecting Tech Pros Worldwide Help | Site Map

focus()

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 20th, 2005, 11:03 AM
Philip WATTS
Guest
 
Posts: n/a
Default 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



  #2  
Old July 20th, 2005, 11:04 AM
Hywel Jenkins
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.