So I’m making an html document to bascially display the uses of some principles. But, I can’t get past the 1st section that requires me to check to make sure atleast one of the dummy checkboxes is checked. Sounds easy enough. Except, even when they’re unchecked I’m getting values. I don’t know why, I’m sure its just something I’m doing. I just don’t know what.
I created the loop to just see what was being passed by checkbox “ch1” – when the box is checked, it returns yes and when it isn’t check it returns yes. Mind. Blown.
<html>
<body>
<script language="vbscript">
<!--
Sub sarah
Set lucy = document.alice
if lucy.ch1.value="yes" then
msgbox(lucy.ch1.value)
end if
End sub
-->
</script>
<h1><center>Assignment #2</center></h1>
<br>
<br>
<form name="alice">
<br>
<br>
<b>Checkboxes</b><br>
Check 1<input type="checkbox" name="ch1" value="yes">
Check 2<input type="checkbox" name="ch2" value="yes">
Check 3<input type="checkbox" name="ch3" value="yes">
Check 4<input type="checkbox" name="ch4" value="yes">
<br>
<br>
<input type="submit" name="butler" value="EDIT and REPORT" onClick="sarah"><br>
</form>
</body>
</html>
Technically they all have a value of yes. You want to check their “checked” state.