Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 11:38 AM
amy
Guest
 
Posts: n/a
Default setfocus after alert in javascript

I have a text box, once the user input the value in, I do a validate
to the input, if it's invalid, then do a alert and set focus to this
control.

The alert displays, but the set focus doesn't work.Here is the client
side javascript code,

if (run!="" && IsNumber(run)==false && decimalinputvalid(run,2)==0 )
{
alert('This field only allows the entry of a maximum of 2 decimal
places. Please re-enter a correct value.');
//set focus
document.papercaltbl.printorder.focus();
}

Please give some advise. Thanks in advance.
  #2  
Old July 19th, 2005, 11:38 AM
Evertjan.
Guest
 
Posts: n/a
Default Re: setfocus after alert in javascript

amy wrote on 02 feb 2004 in microsoft.public.inetserver.asp.general:
[color=blue]
> I have a text box, once the user input the value in, I do a validate
> to the input, if it's invalid, then do a alert and set focus to this
> control.
>
> The alert displays, but the set focus doesn't work.Here is the client
> side javascript code,
>
> if (run!="" && IsNumber(run)==false && decimalinputvalid(run,2)==0 )
> {
> alert('This field only allows the entry of a maximum of 2 decimal
> places. Please re-enter a correct value.');
> //set focus
> document.papercaltbl.printorder.focus();
>}
>
> Please give some advise. Thanks in advance.[/color]

This has nothing to do with ASP, serverside coding.

Please see a clientside js NG.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 

Bookmarks

Thread Tools

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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 network members.
Post your question now . . .
It's fast and it's free

Popular Articles