I have a form which is used to make a Test. User enter a question and provides question type and the Answer options and saves the Question. What has gone wrong is that when the user writes one option and click a button for Add to Options the content of the Text Box for the Options are added to the DOM to show as an answer of the Question. This all was working well Until IE9 was not there.
When the user click on the Add to Options Button the Option is shown in the DOM but the value is not POSTED in IE9.
The function which adds the Option to the DOM is
var tbl = document.getElementById('tbl');
var lastRow = tbl.rows.length;
var iteration = lastRow;
var row = tbl.insertRow(lastRow);
arr[ind] = iteration;
var cellLeft1 = row.insertCell(0);
var cellLeft2 = row.insertCell(1);
var cellLeft3 = row.insertCell(2);
if(document.crt_question.test_ans_view[0].checked)
{
if(document.crt_question.test_ans_choice.value=="0") // MCQ with Single Answer (Radio Buttons)
{
var op_val=document.crt_question.test_answer.value;
var words=op_val.split("");
op_val='';
for(i=0;i<words.length;i++)
{
op_val = op_val + words[i].replace('"',"'");
}
cellLeft1.innerHTML = '<div id="button_div'+ind+'" class="dom_"><input type="radio" name="button_'+ind+'" id="button_'+ind+'" value="'+ind+'" ></div>';
cellLeft2.innerHTML = '|<input type="image" src="../../_images/view_del.gif" onclick="return removeRowFromTable('+ ind +')" />|';
var newOption = document.createElement("input");
newOption.name = "test_answer"+ind+"";
newOption.type = "hidden";
newOption.value = op_val;
var newOption2 = document.createElement("input");
newOption2.name = "view_option"+ind+"";
newOption2.type = "text";
newOption2.value = op_val;
cellLeft3.appendChild(newOption);
cellLeft3.appendChild(newOption2);
ind++;
remove++;
}
}
The Table to which the Options are added is
<table id="tbl" border="0" style="padding-left:70px;">
<tr>
<td align="left"></td>
<td align="left" ></td>
<td align="left"></td>
</tr>
</table>
In the Top function i do not get the Value of either of the Hidden value or the Input Type TEXT field when the form is SUBMITTED. This is working in FF and IE8. Any one can get on this thing?
NOTE: This code is running in a file which is included through an IFRAME.