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 2 of 2
  1. #1
    New Coder
    Join Date
    Dec 2002
    Location
    Washington State
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CheckBox Value? Onload=(CheckBox=Checked)

    I am trying to come up with a script where on the <BODY onLoad=""> command I can run a function which checks a checkbox. However I don't know the value for a checkbox. I am not looking for the VALUE in: <INPUT TYPE="checkbox" VALUE="" NAME=""> I am looking for the value for it being CHECKED if you get what I mean. When it's not checked the default value is: null. Any comments questions is greatly apreciated. Thanks.


    ~Isaac Lloyd~
    ~ Isaac Lloyd ~
    Website Design & Development
    http://www.IsaacLloyd.com

  • #2
    New Coder
    Join Date
    Dec 2002
    Location
    Washington State
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I fixed my own answer in time. Here is what I needed:



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

    function valBox(){
    if(document.getElementById("C1").checked==true){
    return true;
    }
    else if(document.getElementById("C2").checked==true){
    return true;
    }
    else{
    alert('YAY!');
    return false;
    }
    }

    // END-->
    </script>




    ~Isaac Lloyd~
    ~ Isaac Lloyd ~
    Website Design & Development
    http://www.IsaacLloyd.com


  •  

    Posting Permissions

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