Results 1 to 5 of 5

Thread: RESOLVED: javascript: multi-box phone .focus issues

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    RESOLVED: javascript: multi-box phone .focus issues

    I have a form called CustInfo. In this form I have 3 text boxes (phone_1, phone_2, and phone_3). I figured out how after the first 3 digits (area code) I can automatically move to the next text box (phone_2). The issue is if I do a Shift-Tab it doesn't stay. Anyone know how to set it so it stays?

    Here is some of my page info below.

    phone_1 html tag is:
    Code:
    <input name="phone_1" type="text" onKeyUp="fnMoveNext(this, 'phone_2', 3, event);" size="3" maxlength="3">
    phone_2 html tag is:
    Code:
    <input name="phone_2" type="text" onKeyUp="fnMoveNext(this, 'phone_3', 3, event);" size="3" maxlength="3">
    phone_3 html tag is:
    Code:
    <input name="phone_3" type="text" size="3" maxlength="3">
    javascript function is:
    Code:
    function fnMoveNext(obj, name, iMax, evt){
     var vItemLen = obj.value.length;
     var charCode = (evt.which) ? evt.which : event.keyCode
     
     if (vItemLen == iMax) {
       if (charCode != 16){
          eval("document.CustInfo." + name + ".focus()");
       }
     }
    }
    Last edited by lleemon; Dec 15th, 2004 at 02:19 PM. Reason: RESOLVED

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