I did this exact assignment in VBScript today and it did the same thing when I finished and got it to clear the IE debugger. Nothing. No errors, other than the alerts I put in myself, just click the button at the bottom and no HTML code rolls out off of "out".
The fact that its doing it for both assignments makes me think its my browser, someone posted on my other assignment in VBS and said they got it to run fine. So, grab this code and see if you can get a response from "out" for me.
Thank you! Also if you want to cross-reference my VBS HTML with this one its at: http://tinyurl.com/3wqg87u
<html>
<body>
<script language="javascript">
<!--
function sarah()
{
var lucy = document.alice;
var outchk
if
(!lucy.ch1.checked && !lucy.ch2.checked && !lucy.ch3.checked && !lucy.ch4.checked)
{
alert('At least one box must be checked');
return false;
}
if(lucy.ch1.checked)
{
outchk = "Check 1" + " ";
}
if(lucy.ch2.checked)
{
outchk = outchk + "Check 2" + " ";
}
if(lucy.ch3.checked)
{
outchk = outchk + "Check 3" + " ";
}
if(lucy.ch4.checked)
{
outchk = outchk + "Check 4";
}
if (lucy.skeletor.value === "no")
{
alert('Default Option is not a valid selection.');
return false;
}
var tb_val;
var newtbox;
var precut;
var postcut;
tb_val = lucy.tbox.value;
precut = tb_val.length;
newtbox = tb_val.replace(/[/\\*]/g, "");
postcut = newtbox.length;
var bbend;
var bbfore;
var bbafter;
var cleaned;
var bbfinal;
bbend = lucy.bigbend.value;
bbfore = bbend.length;
cleaned = bbend.replace(/[\r\n]/g, "");
bbafter = bbend.length;
bbfinal = cleaned.replace(/ /g, "+");
var out
//*** Radios
out += "<html><body><b><h1><center>Assignment #2 Editing Report</center></b><h1><br><br>"
out += "<b>Radio Information</b><br><br> The radio is named: rad1"
out += "<br><br>The value of each radio position, from left to right, is: Radio 1, Radio 2, Radio 3, Radio 4, Radio 5, Radio 6."
out += "<br><br>The radio button that is checked at load time is, Radio 1. The radio button that was selected by the user was: "
out += lucy.rad1.value + ".<br><br>"
//*** Checkboxes
out += "<b>Checkbox Information</b><br><br> The names of the checkboxes are: ch1, ch2, ch3, ch4. The checkboxes selected by the user were: <br><br>"
out += outchk
//*** Select Box
out += "<b>Select Box Information</b><br><br> The name of the select box is: skeletor. A play on the word selector.<br>"
out += "The options for the select box are, Default Value, Option 2, Option 3, Option 4 and Option 5.<br>"
out += "The values for each option, from top to bottom, are: " + lucy.skeletor.option + ".<br><br>"
out += "The index of the first option in the select box is: 0. The location of the user-selected option is: " + lucy.skeletor.value + ".<br><br>"
//*** Textbox
out += "<b>Textbox Information</b><br><br>The name of the textbox is, tbox. <br>The default value of tbox is ' '.<br>"
out += "Tbox's user-entered value before editing was, '" + tb_val + "', its original length was " + precut + ".<br>Tbox's value after editing is, '"
out += newtbox + "', its length after editing is, " + postcut + ".<br><br>"
//*** Textarea
out += "<b>Textarea Information</b><br><br>The name of the text area is, bigbend. Because its bigger. Its initial value was 'Default Value' and original length was 13. <br>"
out += "The user-entered value before editing was, '" + bbend + "' and its length was " + bbfore + ".<br> The value after editing is, '"
out += bbfinal + "' and its length is, " + bbafter + ".<br></body></html>"
document.getElementById("outboot").innerhtml = out
}
-->
</script>
<h1><center>Assignment #2</center></h1>
<br>
<br>
<form name="alice">
<b>Radios</b><br>
Radio 1<input name="rad1" type="radio" value="Radio 1" checked>
Radio 2<input name="rad1" type="radio" value="Radio 2">
Radio 3<input name="rad1" type="radio" value="Radio 3">
Radio 4<input name="rad1" type="radio" value="Radio 4">
Radio 5<input name="rad1" type="radio" value="Radio 5">
Radio 6<input name="rad1" type="radio" value="Radio 6">
<br>
<br>
<b>Checkboxes</b><br>
Check 1<input type="checkbox" name="ch1">
Check 2<input type="checkbox" name="ch2">
Check 3<input type="checkbox" name="ch3">
Check 4<input type="checkbox" name="ch4">
<br>
<br>
<b>Select Box</b><br>
<select name="skeletor">
<option value="no" selected>Default Value</option>
<option value="op2">Option 2</option>
<option value="op3">Option 3</option>
<option value="op4">Option 4</option>
<option value="op5">Option 5</option>
</select>
<br>
<br>
<b>Textbox</b><br>
<input type="text" name="tbox" maxlength="30" value=" " size="30">
<br>
<br>
<b>Textarea</b><br>
<textarea name="bigbend" rows="5" cols="40">Default Value</textarea>
<br>
<br>
<input type="button" name="butler" value="EDIT and REPORT" onClick="sarah();"><br>
</form>
<span id="outboot"></span>
</body>
</html>
Your using
.innerhtml
(Incorrect case) so change the last line of your function to;Also you should not insert
"</body></html>"
into your results span as they already exist in the document.