I have a html form that appears not to be functional in IE10. when click on go button debugging returns:"SCRIPT5007: Unable to get property 'value' of undefined or null reference"
I have added this tag in my html page
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />.
html contains dropdown menu option for frequency in myform.After selecting any option in dropdown i am calling below javascript function.
function chooseFreqMenu(freqValues,freqTexts)
{
var cf = document.myform;
var freq1=document.myform.freq.value; // freq1="d"
alert(freq1);// displaying freq1 value is "d" (ex:selected 'd' in html dropdown)
// checking some condition for freqValues.
for(var i=4;i<freqValues.length;i++)
selectStr += '<option value="'+freqValues[i]+'">'+freqTexts[i]+'
';
}
selectStr += '</select>';
// Assinging the selectedStr to innerHTML. After this statement i am getting empty for freq1 value.
//Its working fine in IE<10 browsers
document.all.freqSel.innerHTML = selectStr;
alert(freq1); // displaying freq1 value is empty.
}
Before sending myform to chooseFreqmenu, myform contains freq value="d"(assume i selected 'd' in dropdown)
After the above function myform doesn't contain freq value.
After the above function passing myform to buildQueryStr.
function buildQueryStr(myform)
{
var freq=myform.freq.value; //Getting an error SCRIPT5007: Unable to get property 'value' of undefined or null reference in this line
//some other fields.
}
How to fix this issue?
Any suggestions?? Thanks in Advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…