Results 1 to 2 of 2

Thread: HELP, focus not working help!

  1. #1

    Default HELP, focus not working help!

    Hi, building a website and my focus isn't working, my code follows:

    <head>
    <script lang="javascript">
    function checkemail() {
    var EmailAddress = (tella.email1.value);
    var Length = EmailAddress.length;
    var Count = 0;
    var Loop = 0;
    var Character
    while (Loop < Length) {
    Character = EmailAddress.charAt(Loop);
    if (Character == "@") {
    Count = Count + 1;
    }
    Loop = Loop + 1;
    }
    if (Count != 1) {
    alert("Please check your email address");
    tella.email1.focus(); // this line doesn't work, it will not focus back to the box

    }
    else
    {checkemail2()}
    }
    function checkemail2() {
    var EmailAddress = (tella.email2.value);
    var Length = EmailAddress.length;
    var Count = 0;
    var Loop = 0;
    var Character
    while (Loop < Length) {
    Character = EmailAddress.charAt(Loop);
    if (Character == "@") {
    Count = Count + 1;
    }
    Loop = Loop + 1;
    }
    if (Count != 1) {
    alert("Please check your friends email address");
    tella.email2.focus();// same thing happens

    }
    else
    {submitit()}
    }
    function submitit() {
    alert("You have told your friend about McCue Bros & Co")
    }
    </script>


    <title>McCue Brothers & Co</title>
    </head>

  2. #2

Posting Permissions

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