M
mortb
I create a table containing radiobuttons in client script depending on
what choices the user makes.
It works fine the radio buttons appear *but* they are *not clickable*.
Why? Is there a solution?
I'm using IE 6.0
cheers,
mortb
actual code included (cut from a larger page):
<script language='javascript'>
var GUIArr = new Array(new Array('gui1',36,'type1',16,16), new
Array('gui2',37,'type1',16,16))
</script>
<html>
<body>
<form>
<script language="javascript">
function populateGUIRadioList()
{
var table =
document.frmIcon.getElementById("radioTab");
// alert(table.rows.length);
//alert(document.getElementById("searchGUIType").value)
var TRs = table.getElementsByTagName("tr");
// alert(TRs.length);
var len = TRs.length;
for(i=0;i < len; i++)
{
table.deleteRow();
}
var GUIType =
document.getElementById("searchGUIType").value;
var GUIWidth =
document.getElementById("searchGUIWidth").value.replace(/[^0-9]./,
"");
var GUIHeight =
document.getElementById("searchGUIHeight").value.replace(/[^0-9]./,
"");
//alert(document.getElementById("searchGUIType").value);
for(i = 0; i < GUIArr.length; i ++)
{
if((GUIType == "" ||GUIType == GUIArr[2])
&& (GUIWidth == "" ||GUIWidth == GUIArr[3])
&& (GUIHeight == "" ||GUIHeight ==
GUIArr[4]))
{
var row =
table.insertRow();//document.createElement("tr");
var cell = document.createElement("td");
var text =
document.createTextNode(GUIArr[0] + " - " + GUIArr[2] + " " +
GUIArr[3] + " x " + GUIArr[4]);
var rdbtn =
document.createElement("input");
rdbtn.type = "radio";
rdbtn.value = GUIArr[1];
rdbtn.name = "displayGUIObject";
cell.appendChild(rdbtn);
cell.appendChild(text);
row.appendChild(cell);
}
}
}
</script>
<input type="text" id="searchGUIWidth" maxlength="4"
size="4" onkeyup="populateGUIRadioList()"> x
<input type="text" id="searchGUIHeight" maxlength="4"
size="4" onkeyup="populateGUIRadioList()">
<select id="searchGUIType"
onchange="populateGUIRadioList()">
<option value=""><All types></option>
<option value="type1">type1</option>
<option value="<= 256 Colors">Icon <=256</option>
<option value="> 256 Colors">Icon >256</option>
</select>
<table id="radioTab">
</table>
</form>
</body>
</html>
what choices the user makes.
It works fine the radio buttons appear *but* they are *not clickable*.
Why? Is there a solution?
I'm using IE 6.0
cheers,
mortb
actual code included (cut from a larger page):
<script language='javascript'>
var GUIArr = new Array(new Array('gui1',36,'type1',16,16), new
Array('gui2',37,'type1',16,16))
</script>
<html>
<body>
<form>
<script language="javascript">
function populateGUIRadioList()
{
var table =
document.frmIcon.getElementById("radioTab");
// alert(table.rows.length);
//alert(document.getElementById("searchGUIType").value)
var TRs = table.getElementsByTagName("tr");
// alert(TRs.length);
var len = TRs.length;
for(i=0;i < len; i++)
{
table.deleteRow();
}
var GUIType =
document.getElementById("searchGUIType").value;
var GUIWidth =
document.getElementById("searchGUIWidth").value.replace(/[^0-9]./,
"");
var GUIHeight =
document.getElementById("searchGUIHeight").value.replace(/[^0-9]./,
"");
//alert(document.getElementById("searchGUIType").value);
for(i = 0; i < GUIArr.length; i ++)
{
if((GUIType == "" ||GUIType == GUIArr[2])
&& (GUIWidth == "" ||GUIWidth == GUIArr[3])
&& (GUIHeight == "" ||GUIHeight ==
GUIArr[4]))
{
var row =
table.insertRow();//document.createElement("tr");
var cell = document.createElement("td");
var text =
document.createTextNode(GUIArr[0] + " - " + GUIArr[2] + " " +
GUIArr[3] + " x " + GUIArr[4]);
var rdbtn =
document.createElement("input");
rdbtn.type = "radio";
rdbtn.value = GUIArr[1];
rdbtn.name = "displayGUIObject";
cell.appendChild(rdbtn);
cell.appendChild(text);
row.appendChild(cell);
}
}
}
</script>
<input type="text" id="searchGUIWidth" maxlength="4"
size="4" onkeyup="populateGUIRadioList()"> x
<input type="text" id="searchGUIHeight" maxlength="4"
size="4" onkeyup="populateGUIRadioList()">
<select id="searchGUIType"
onchange="populateGUIRadioList()">
<option value=""><All types></option>
<option value="type1">type1</option>
<option value="<= 256 Colors">Icon <=256</option>
<option value="> 256 Colors">Icon >256</option>
</select>
<table id="radioTab">
</table>
</form>
</body>
</html>