matyhaty
10-06-2005, 05:25 PM
Hi all.
I wonder if anyone can help me out here.
This works fine in IE6, but does some very strange things in Moz.
Below is the Javascript function i wrote.....
There is one for each question.
debug = 1;
function questionEleven (value)
{
if(debug) alert(value + "Function Question Eleven");
data = "";
if(value == 1)
{
if(debug) alert("YES!!!");
data += '<table width="455" border="0" cellspacing="0" cellpadding="5">';
data += '<tr><td width="219">What are their names?</td>';
data += '<td width="216"><textarea name="enquiry222" cols="20" id="enquiry222"></textarea></td></tr>';
data += '</table>'
}
if (document.layers)
{
document.layers.q11.document.write(data);
document.layers.q11.document.close();
}
else
{
if (document.all)
{
q11.innerHTML = data;
if(debug) window.alert("ALL");
}
}
} // end function questionEelven
And where you want the new question to go it below (in the BODY), and the radio buttons which activate it all.
<label>
<input name="question11" type="radio" value="radiobutton" onClick="questionEleven(1);"/>
Yes
<input name="question11" type="radio" value="radiobutton" onClick="questionEleven(0);"/>
No
</label>
<!-- Placeholder for dynamic form contents Question 11-->
<span id=q11 style="position:relative;"></span>
This works fine in IE, but in Moz, you click on the yes radio, and it calls the function, but no new question is written. Click on No, and it calls the function (passing a 0) then it calls the function again (passing a 1) and then swpas the radio to the "Yes" one being checked! (all in a single click)
Can anyone help me here?
Thanks
I wonder if anyone can help me out here.
This works fine in IE6, but does some very strange things in Moz.
Below is the Javascript function i wrote.....
There is one for each question.
debug = 1;
function questionEleven (value)
{
if(debug) alert(value + "Function Question Eleven");
data = "";
if(value == 1)
{
if(debug) alert("YES!!!");
data += '<table width="455" border="0" cellspacing="0" cellpadding="5">';
data += '<tr><td width="219">What are their names?</td>';
data += '<td width="216"><textarea name="enquiry222" cols="20" id="enquiry222"></textarea></td></tr>';
data += '</table>'
}
if (document.layers)
{
document.layers.q11.document.write(data);
document.layers.q11.document.close();
}
else
{
if (document.all)
{
q11.innerHTML = data;
if(debug) window.alert("ALL");
}
}
} // end function questionEelven
And where you want the new question to go it below (in the BODY), and the radio buttons which activate it all.
<label>
<input name="question11" type="radio" value="radiobutton" onClick="questionEleven(1);"/>
Yes
<input name="question11" type="radio" value="radiobutton" onClick="questionEleven(0);"/>
No
</label>
<!-- Placeholder for dynamic form contents Question 11-->
<span id=q11 style="position:relative;"></span>
This works fine in IE, but in Moz, you click on the yes radio, and it calls the function, but no new question is written. Click on No, and it calls the function (passing a 0) then it calls the function again (passing a 1) and then swpas the radio to the "Yes" one being checked! (all in a single click)
Can anyone help me here?
Thanks