Forum Moderators: open
Any help would be appreeciated.
Thanks...Larry
1. Opening a new window, using the method window.open
2. The following is a code bit:
test = window.open('','ASSESSMENT',
'toolbar=no,width=640,height=480,status=no,scrollbars=yes,resizable=yes,menubar=no');
//window.focus();
with (test.document)
{
open();
write('<html>\n<head>\n' + '<title>GoToLearn ' + formID + ' Assessment</title>\n');
write('<script language="JavaScript" src="resources.js">\n' + '</script>\n');
write('<style type="text/css">\n' +
'input \n' +
'{\n' +
'font-size: 14px;\n' +
'font-family: "Arial", "Helvetica", sans-serif;\n' +
'color: #000000;\n' +
'}\n' +
'td\n' +
'{\n' +
'font-size: 14px;\n' +
'font-family: "Arial", "Helvetica", sans-serif;\n' +
'color: #000000;\n' +
'}\n' +
'h3\n' +
'{\n' +
'font-size: 18px;\n' +
'font-family: "Arial", "Helvetica", sans-serif;\n' +
'color: #000000;\n' +
'}\n' +
'.control\n' +
'{\n' +
'font-size: 14px;\n' +
'font-family: "Arial", "Helvetica", sans-serif;\n' +
'background-color: #ffff00;\n' +
'color: #000000;\n' +
'}\n' +
'</style>\n' +
'</head>\n');
write('<body bgcolor="#ddffdd">\n');
// document container table
write('<table width="610" >\n' +
'<tr>\n' +
'<td >\n' +
'<table cellspacing="0" cellpadding="0">\n' +
'<tr>\n' +
'<td width="150" height="85">\n' +
'<img src="logo.gif" width="140" >\n' +
'</td>\n' +
'<td align="center" width="400">\n' +
'<b>\n' +
'Click the Submit button after<br>\n' +
'you have completed the assessment.<br><br>\n' +
'Click the Formulas button for<br>\n' +
'formulas and conversions.\n' +
'</b>\n' +
'</td>\n' +
'<td align="center" width="90">\n' +
'<font size="-1">' + formID + '</font><br>' +
'<form>\n' +
'<input type=button class="control" value="Submit" onclick="javascript:opener.gradeTest();">\n' +
'<input type=button class="control" value="Formulas" onclick="javascript:opener.displayFormula();">\n' +
'</form>\n' +
'</td>\n' +
'</tr>\n' +
'</td colspan="2">\n' +
'</table>\n' +
'<hr>\n');
//************* alert("here we are"); ***************//
for (var i = 0; i < numberToPresent; i++)
{
index = shuffledOrder[i];
write('<h3>Problem \n' + (i + 1) + ' of \n' + numberToPresent + '</h3>\n' +
// Outer one-problem table
'<table width="100%" cellspacing="0" cellpadding="0">\n' +
'<tr>\n' +
// left main cell
'<td width="400" valign="top">\n' +
'<b>\n' +
'</b><br>\n' +
'<img src="../GRAPHICS/' + problems[index].graphicPath + '"> \n' +
'<br>\n' +
'<img src="../GRAPHICS/placeholder.gif"> \n' +
'</td>\n' +
// end left main cell
// right main cell
'<td align="center" valign="center">\n' +
'<form>\n');
// answer table
write('<table width="100%" >\n' +
// empty row: helps format; room for another element . . .
'<tr><td colspan="4"><br></td></tr>\n' +
// 'A' choice
'<tr><td><br></td><td width="5%"><b>A.</b></td><td width="5%">\n' +
'<input type=radio name="answer' + index + '" value="A"\n' +
'onClick="javascript:opener.answers[' + index + '] = this.value;"></td>\n' +
'<td width="90%"><br></td></tr>\n' +
// 'B' choice
'<tr><td><br></td><td><b>B.</b></td>\n' +
'<td><input type=radio name="answer' + index + '" value="B"\n' +
'onClick="javascript:opener.answers[' + index + '] = this.value;"></td>\n' +
'<td><br></td></tr>\n' +
// 'C' choice
'<tr><td><br></td><td><b>C.</b></td>\n' +
'<td><input type=radio name="answer' + index + '" value="C"\n' +
'onClick="javascript:opener.answers[' + index + '] = this.value;"></td>\n' +
'<td><br></td></tr>\n' +
// 'C' choice
'<tr><td><br></td><td><b>D.</b></td>\n' +
'<td><input type=radio name="answer' + index + '" value="D"\n' +
'onClick="javascript:opener.answers[' + index + '] = this.value;"></td>\n' +
'<td><br></td></tr>\n' +
'</table>\n' +
// end answer table
'</form>\n' +
'</td>\n' +
// end right main cell
'</tr>\n' +
'</table><!-- outer table -->\n' +
// end outer table
'<hr>\n');
}
write('</td>\n' +
'</tr>\n' +
'</table>\n' +
// end container table
'</body></html>\n');
close();
}
[edited by: tedster at 7:52 pm (utc) on April 17, 2003]
I'd suggest you review the code to figure out what attribute is offending (or move the debug alert() call progressively lower to find out), then put the code that accesses the element in an onload() function for the new pop-up.
Shawn