setfocus after alert in javascript

Discussion in 'ASP General' started by amy, Feb 2, 2004.

  1. amy

    amy Guest

    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.
    amy, Feb 2, 2004
    #1
    1. Advertising

  2. amy

    Evertjan. Guest

    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)
    Evertjan., Feb 2, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mad Scientist Jr

    asp.net setfocus after validation not working

    Mad Scientist Jr, Jul 13, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    6,738
    Mad Scientist Jr
    Jul 15, 2004
  2. ton
    Replies:
    0
    Views:
    500
  3. Joe

    SetFocus using Javascript

    Joe, Oct 29, 2003, in forum: ASP General
    Replies:
    0
    Views:
    160
  4. amy

    setfocus after alert in javascript

    amy, Feb 2, 2004, in forum: Javascript
    Replies:
    1
    Views:
    107
    DJ WIce
    Feb 3, 2004
  5. amy

    setfocus after alert in javascript

    amy, Feb 4, 2004, in forum: Javascript
    Replies:
    0
    Views:
    90
Loading...

Share This Page