Johnny
asked on
vbscript: i keep getting an error with this and i dont know why..any help would be great thanks
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Check Boxes</title>
<script>
function checkAll(objCheck){
objForm = document.forms[0];
if(objCheck.checked){
bolChecked = true;
}else{
bolChecked = false;
}
for(i=0;i<objForm.elements .length;i+ +){
if(objForm.elements[i].typ e=="checkb ox"){
objForm.elements[i].checke d = bolChecked;
}
}
}
function checkBoxes (chkBox) {
var theCheckBox="chkBox"+chkBo x.id;
if(chkBox.checked) {
document.getElementById(th eCheckBox) .innerHTML ='Install' ;
}else{
document.getElementById(th eCheckBox) .innerHTML ='Do Not Install';
}
}
function CheckSome(){
document.frmChecks.chkChec k_3.checke d = true;
checkBoxes("3");
document.frmChecks.chkChec k_5.checke d = true;
checkBoxes("5");
}
function pageInit(){
CheckSome();
}
</script>
</head>
<body onLoad=pageInit()>
<td>
<form action="http://www.fairfieldconsulting.com/processForm.asp" method="post" name="frmChecks" id="frmChecks">
<input id="1" type="checkbox" name="chkCheck_1" onclick="checkBoxes(this)" ><span id="chkBox1">Do Not Install this program 1</span>
<br>
<input id="2" type="checkbox" name="chkCheck_2" onclick="checkBoxes(this)" ><span id="chkBox2">Do Not Install</span>
<br>
<input id="3" type="checkbox" name="chkCheck_3" onclick="checkBoxes(this)" ><span id="chkBox3">Do Not Install</span>
<br>
<input id="4" type="checkbox" name="chkCheck_4" onclick="checkBoxes(this)" ><span id="chkBox4">Do Not Install</span>
<br>
<input id="5" type="checkbox" name="chkCheck_5" onclick="checkBoxes(this)" ><span id="chkBox5">Do Not Install</span>
<br><br>
<input type="checkbox" name="chkCheck" value="" onClick="checkAll(this)">C heck / Uncheck All<br />
<br>
<input type=button onClick="CheckSome()" value="Default">
<input name="Reset" type="reset" onclick="checkBoxes(this)" >
<input name="MySubmit" type="submit" onClick="VBScript:MsgBox(' Submitted! ')">
</form>
</td>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Check Boxes</title>
<script>
function checkAll(objCheck){
objForm = document.forms[0];
if(objCheck.checked){
bolChecked = true;
}else{
bolChecked = false;
}
for(i=0;i<objForm.elements
if(objForm.elements[i].typ
objForm.elements[i].checke
}
}
}
function checkBoxes (chkBox) {
var theCheckBox="chkBox"+chkBo
if(chkBox.checked) {
document.getElementById(th
}else{
document.getElementById(th
}
}
function CheckSome(){
document.frmChecks.chkChec
checkBoxes("3");
document.frmChecks.chkChec
checkBoxes("5");
}
function pageInit(){
CheckSome();
}
</script>
</head>
<body onLoad=pageInit()>
<td>
<form action="http://www.fairfieldconsulting.com/processForm.asp" method="post" name="frmChecks" id="frmChecks">
<input id="1" type="checkbox" name="chkCheck_1" onclick="checkBoxes(this)"
<br>
<input id="2" type="checkbox" name="chkCheck_2" onclick="checkBoxes(this)"
<br>
<input id="3" type="checkbox" name="chkCheck_3" onclick="checkBoxes(this)"
<br>
<input id="4" type="checkbox" name="chkCheck_4" onclick="checkBoxes(this)"
<br>
<input id="5" type="checkbox" name="chkCheck_5" onclick="checkBoxes(this)"
<br><br>
<input type="checkbox" name="chkCheck" value="" onClick="checkAll(this)">C
<br>
<input type=button onClick="CheckSome()" value="Default">
<input name="Reset" type="reset" onclick="checkBoxes(this)"
<input name="MySubmit" type="submit" onClick="VBScript:MsgBox('
</form>
</td>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you for posting the complete script too...
i couldnt figure it out
thanks alot
i couldnt figure it out
thanks alot
Thanks for the points and grade
document.frmChecks.chkChec
checkBoxes(document.frmChe
document.frmChecks.chkChec
checkBoxes(document.frmChe
}