22 users online (0 members and 22 guests)  


  Results 1 to 4 of 4

Related

  1. Replies: 3
  2. Submit button!?!?    Forum: HTML Forum
    Replies: 1
  3. Replies: 1
  4. Submit button mailer help    Forum: PHP Forum
    Replies: 0
  5. form submit button    Forum: HTML Forum
    Replies: 1
  1. #1
    navin882's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2008
    Posts
    6

    Exclamation Default focus on submit button

    Hi all,
    Can any 1 tell me how to get the default focus on a submit button.
    I have the following code .
    <TR> <TD>
    <input name="Action1" type="submit" id="Action1" value="Submit" onClick="javascript:statcheck('Search');">
    </TD></TR>

    Please Advise.thanks in advance.

  2. #2
    rangana's Avatar
    Moderator/Allstar

    Status
    Offline
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    317

    Re: Default focus on submit button

    Hi navin882,
    This should work:
    [code]
    <script type="text/javascript">
    window.onload = function() {
    document.getElementById('Action1').focus();
    }
    </script>

    See if it helps

  3. #3
    navin882's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2008
    Posts
    6

    Thumbs up Re: Default focus on submit button

    thanks.

  4. #4
    rangana's Avatar
    Moderator/Allstar

    Status
    Offline
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    317

    Re: Default focus on submit button

    No problem!...You're welcome



Tags for this Thread