Results 1 to 4 of 4

Thread: Two questions. 1. Reg'd Prompt Box. 2. Reg'd Auto Tab script.

  1. #1

    Thread Starter
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330

    Two questions. 1. Reg'd Prompt Box. 2. Reg'd Auto Tab script.

    Hi,

    1. Is there any way to get a prompt box to show up in the middle of the screen rather than the top-left?

    2. I'm looking for some code that will move to the next text box when 2 characters are entered in the current box.

    Thanks,
    Al.
    A computer is a tool, not a toy.

  2. #2
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    For centering, try:

    <form>
    <br><br><br><br><br><br><br><br>
    <center><input name="prompt_box"></center>
    </form>

    For auto-tabbing you would use JavaScript and you would add an
    onChange="tabFunction(this)" to your input field, i.e.:
    <input name="prompt_box" onChange="tabFunction(this)">

    Then you would set up the tabFunction(string) to check to see if string.length is greater than 2 and if so, tab to the next field.

    cudabean

  3. #3

    Thread Starter
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330
    Thanks for the reply. I was able to get the tab function to work.
    The prompt box is a JavaScript prompt. e.g.
    Code:
    function EnterPrice(){
    Price=prompt("Item 12345 is not in the price file. Please enter your price.");
    ....
    }
    It's this prompt box I'm trying to center on the screen.
    Thanks,
    Al.
    A computer is a tool, not a toy.

  4. #4
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    1/ Dont think its possible, it just pops up where it wants too. I'd use a <input type="text"> instead

    2/ Try This...

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>
    <head>
    <title>Set Focus After Length Of Characters Has Exceeded</title>

    <script language="JavaScript" type="text/javascript">
    <!--

    // objectID is ID of element
    // activateID is ID of element you want to give focus too
    // maximum is the maximum length before activateID gets focus

    function checkLength(objectID,activateID,maximum){
    if (document.getElementById(objectID).value.length==maximum){
    document.getElementById(activateID).focus();
    }
    }
    //-->
    </script>

    </head>
    <body>
    <form name="form1">
    <input type="text" name="text1" id="text1" onkeypress="checkLength('text1','text2',2)">
    <input type="text" name="text2" id="text2" onkeypress="checkLength('text2','text3',2)">
    <input type="text" name="text3" id="text3">
    </form>
    </body>
    </html>

    Hope this helps
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width