Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2005
    Location
    Utah
    Posts
    65
    Thanks
    6
    Thanked 0 Times in 0 Posts

    select checkbox after page loads

    I have a function that works with checkboxes, but when the page loads it clears one of the checkboxes that I want checked. Even when I have "checked" in the input tag. How can I set a time so it will be checked after tha page loads, like 2-3 seconds?

  • #2
    New Coder
    Join Date
    May 2005
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well you might just wanna try as soon as it loads, try this:

    <script language="javascript" type="text/javascript">

    function check(){
    document.formname.inputname.checked="checked";
    }

    </script>

    <body onload="check()">

    And just replace formname and inputname with your form and input names.

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Quote Originally Posted by Shwaza
    document.formname.inputname.checked="checked";
    Should be true not "checked".

    document.formname.inputname.checked=true;
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

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