R
Ralph
Hi
I have small function to generate my form controls:
function buildInput(sType, vValue, vId, sName, sLabel){
var oInput = null;
var oLabel = document.createElement('label');
var oCont = document.createElement('span');
var oText = document.createTextNode(sLabel);
oInput = document.createElement('<input type="'+ sType +'" name="'+ sName +'" />');
oInput.id = vId;
oInput.value = vValue;
oLabel.appendChild(oText);
oLabel.setAttribute('for', vId);
oCont.appendChild(oInput);
oCont.appendChild(oLabel);
return oCont;
}
The function is generating code like this:
<SPAN><INPUT id="1062" type="radio" name="mainIntr" value="Television" /><LABEL
for="1062">Television</LABEL></SPAN>
The controls are generated OK but when i click the label next to radio button it's not selecting it.
On the other hand when i hard code the same code in my HTML file i can select the radio button by
clicking the label next to it.
How can I generate this code so it works?
PS: i have no problems with FF only IE.
Thank you
I have small function to generate my form controls:
function buildInput(sType, vValue, vId, sName, sLabel){
var oInput = null;
var oLabel = document.createElement('label');
var oCont = document.createElement('span');
var oText = document.createTextNode(sLabel);
oInput = document.createElement('<input type="'+ sType +'" name="'+ sName +'" />');
oInput.id = vId;
oInput.value = vValue;
oLabel.appendChild(oText);
oLabel.setAttribute('for', vId);
oCont.appendChild(oInput);
oCont.appendChild(oLabel);
return oCont;
}
The function is generating code like this:
<SPAN><INPUT id="1062" type="radio" name="mainIntr" value="Television" /><LABEL
for="1062">Television</LABEL></SPAN>
The controls are generated OK but when i click the label next to radio button it's not selecting it.
On the other hand when i hard code the same code in my HTML file i can select the radio button by
clicking the label next to it.
How can I generate this code so it works?
PS: i have no problems with FF only IE.
Thank you