Hello. I made a form, and it reads the data from a file. For that I'm using tabular data contol and it was running OK, but when I ran it in another machine that has Internet Explorer 5.5 it did not run. I read that Tabular Data Control can be used from version 4. Does anyone know how can I solve the problem??????
The error message is this:
Operation is not allowed when the object is closed
This is the code of the program:
function fact(){
var dataSet = data1.recordset; //Get the complete data record set
// Creates the html form and tables. THE ACTION OPTIONS IS SENDING THE RESULTS TO AN EMAIL ADDRESS
document.write('<FORM NAME="questions" onSubmit="return valForm(document.questions);" METHOD="POST" ACTION="mailto:ramakrishna@streetone.com" TARGET="questionspoints.html">');
document.write('<td width="25" bgColor=#595959><img src="login_files/tom.gif" border="0" width="25" height="1"></td>');
document.write('<td valign=top bgColor=#595959>');
document.write('<TABLE cellpadding="0" cellspacing="0" border="0" width="470" align="left" valign="top" bgcolor="E4E4E4">');
while (!dataSet.EOF)
{
if (dataSet.Fields(0).value == que) //compares if the field(0) is in a question 1=1 or ''=1
{
que++; // increments when is a question in field0, controls how many questions are in the questionnaire
opt=1; // Restarts the opt counter. Opt controls the option number
if ( ((que-1) == 6) && (opt == 1) ) //When it is in question 6, it will create another table to divide the questionnaire in two tables.
{
document.write('</table></td> <td valign=top bgColor=#595959 >');
document.write('<TABLE cellpadding="0" cellspacing="0" border="0" width="470" align="right" valign="top" bgcolor="E4E4E4">');
}
// Prints the QUESTION
document.write('<TR bgColor=#FFFFFF valign="top">');
document.write('<td width="20"><b> Q'+(que-1)+'. </td>');
document.write('<td colspan=2><b> '+dataSet.Fields(1).value+'</b></td>'); // Writes the question
document.write('</TR>');
}
else //prints the radio buttoms and options
{
document.write('<tr bgcolor="E4E4E4">');
document.write('<Td width=5>');
//O AND P are used to control the input name: q1, q2, q3
o="q"+(que-1); //o = "q"1, "q"2, "q"3, etc.
p=o.toString(); //p = "q1", "q2", "q3", etc.
points[que-1][opt]=parseInt(dataSet.Fields(3).value);
document.write('<input type=radio name="'+p+'" value="'+opt+'"> ');
document.write('</td>');
if ( dataSet.Fields(4).value == '' )
{document.write('<td colspan=2>'+dataSet.Fields(2).value+'</td></tr>');}
else {
document.write('<td>'+dataSet.Fields(2).value+'</td>');
document.write('<td><font color=#595959>'+dataSet.Fields(4).value+'</font></td></tr>');
}
data1.recordset.movenext();
opt++;
}
}
document.write('</table></td>');
document.write('<td width="25" bgColor=#595959><img src="login_files/tom.gif" border="0" width="25" height="1"></td>');
document.write('<tr bgColor=#595959 align="center"> <td colspan=4><br><input type=submit value="Submit Questionnaire"><br><br></td></tr>');
document.write('</FORM>');
}
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="../js/evaluate.js"></SCRIPT>
I hope someone knows something about this.
The error message is this:
Operation is not allowed when the object is closed
This is the code of the program:
function fact(){
var dataSet = data1.recordset; //Get the complete data record set
// Creates the html form and tables. THE ACTION OPTIONS IS SENDING THE RESULTS TO AN EMAIL ADDRESS
document.write('<FORM NAME="questions" onSubmit="return valForm(document.questions);" METHOD="POST" ACTION="mailto:ramakrishna@streetone.com" TARGET="questionspoints.html">');
document.write('<td width="25" bgColor=#595959><img src="login_files/tom.gif" border="0" width="25" height="1"></td>');
document.write('<td valign=top bgColor=#595959>');
document.write('<TABLE cellpadding="0" cellspacing="0" border="0" width="470" align="left" valign="top" bgcolor="E4E4E4">');
while (!dataSet.EOF)
{
if (dataSet.Fields(0).value == que) //compares if the field(0) is in a question 1=1 or ''=1
{
que++; // increments when is a question in field0, controls how many questions are in the questionnaire
opt=1; // Restarts the opt counter. Opt controls the option number
if ( ((que-1) == 6) && (opt == 1) ) //When it is in question 6, it will create another table to divide the questionnaire in two tables.
{
document.write('</table></td> <td valign=top bgColor=#595959 >');
document.write('<TABLE cellpadding="0" cellspacing="0" border="0" width="470" align="right" valign="top" bgcolor="E4E4E4">');
}
// Prints the QUESTION
document.write('<TR bgColor=#FFFFFF valign="top">');
document.write('<td width="20"><b> Q'+(que-1)+'. </td>');
document.write('<td colspan=2><b> '+dataSet.Fields(1).value+'</b></td>'); // Writes the question
document.write('</TR>');
}
else //prints the radio buttoms and options
{
document.write('<tr bgcolor="E4E4E4">');
document.write('<Td width=5>');
//O AND P are used to control the input name: q1, q2, q3
o="q"+(que-1); //o = "q"1, "q"2, "q"3, etc.
p=o.toString(); //p = "q1", "q2", "q3", etc.
points[que-1][opt]=parseInt(dataSet.Fields(3).value);
document.write('<input type=radio name="'+p+'" value="'+opt+'"> ');
document.write('</td>');
if ( dataSet.Fields(4).value == '' )
{document.write('<td colspan=2>'+dataSet.Fields(2).value+'</td></tr>');}
else {
document.write('<td>'+dataSet.Fields(2).value+'</td>');
document.write('<td><font color=#595959>'+dataSet.Fields(4).value+'</font></td></tr>');
}
data1.recordset.movenext();
opt++;
}
}
document.write('</table></td>');
document.write('<td width="25" bgColor=#595959><img src="login_files/tom.gif" border="0" width="25" height="1"></td>');
document.write('<tr bgColor=#595959 align="center"> <td colspan=4><br><input type=submit value="Submit Questionnaire"><br><br></td></tr>');
document.write('</FORM>');
}
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="../js/evaluate.js"></SCRIPT>
I hope someone knows something about this.