...

View Full Version : CheckBox Value? Onload=(CheckBox=Checked)



isaaclloyd
03-22-2005, 09:08 PM
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~

isaaclloyd
03-22-2005, 10:01 PM
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~



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum