Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > setfocus after alert in javascript

Reply
Thread Tools

setfocus after alert in javascript

 
 
amy
Guest
Posts: n/a
 
      02-02-2004
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.
 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      02-02-2004
amy wrote on 02 feb 2004 in microsoft.public.inetserver.asp.general:

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


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)
 
Reply With Quote
 
 
 
Reply

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to setfocus and keep currentselected Treenode VISIBLE after postback (VB) ton ASP .Net 0 04-02-2008 06:06 PM
asp.net setfocus after validation not working Mad Scientist Jr ASP .Net 4 07-15-2004 06:46 PM
setfocus after alert in javascript amy Javascript 0 02-04-2004 06:44 PM
setfocus after alert in javascript amy Javascript 1 02-03-2004 08:53 AM
SetFocus using Javascript Joe ASP General 0 10-29-2003 02:09 PM



Advertisments