Hi, I've searched the forum for this problem but haven't found anything relevant.
I've got a javascript code which dynamically creates list-boxes in a form. It
works perfectly fine in IE, but in Firefox 2 I change the selected value in
a list-box but nothing gets submitted via POST.
The dynamic list-box creation code looks like this:
[HTML]
<form name="form0" method=POST action="/dynamic/AppDirector/Global/GlobalParameter s" onkeypress="ret urn webDefaultFormK eyHandler(this, event,IDN_Conve rsion_Page_Set_ Handler)">
<table border=0>
<tr><td class="varName" >
<b>Open New Entry When Source Port Different</b>
</td>
<td class="varValue " id="varValue1" >
<input type="hidden" name="mibId_0" value="187">
<script language="JavaS cript1.2" type="text/javascript">
var187_0Object = new SelectBox("var1 87_0","varValue 1");
var187_0Object. add("enable","e nable");
var187_0Object. add("disable"," disable");
var187_0Object. setValue("disab le");
</script></td></tr>[/HTML]
SelectBox is defined in another javascript file, and the code goes like this:
[CODE=javascript]
function SelectBoxSetVal ue(value) {
options = this.sel.option s;
for (i=0;i<options. length;i++) {
if (options[i].value == value) {
this.sel.select edIndex = i;
}
}
}
function SelectBoxAdd(te xt,value)
{
ops = this.sel.option s;
for (i=0;i<ops.leng th;i++) {
if (ops[i].text == text) {
return;
}
}
o = document.create Element("OPTION ");
o.text = text;
o.value = value;
addoption(this. sel,o);
}
function SelectBox(name, parentId) {
this.sel = document.create Element("SELECT ");
this.sel.name = name;
this.sel.id = name;
if (parentId != null) {
this.par = document.getEle mentById(parent Id);
} else {
this.par = document;
}
this.add = SelectBoxAdd;
this.remove = SelectBoxRemove ;
this.setValue = SelectBoxSetVal ue;
this.par.append Child(this.sel) ;
}
[/CODE]
Can anyone give some pointers as to why this wouldn't work in Firefox?
Thanks in advance
I've got a javascript code which dynamically creates list-boxes in a form. It
works perfectly fine in IE, but in Firefox 2 I change the selected value in
a list-box but nothing gets submitted via POST.
The dynamic list-box creation code looks like this:
[HTML]
<form name="form0" method=POST action="/dynamic/AppDirector/Global/GlobalParameter s" onkeypress="ret urn webDefaultFormK eyHandler(this, event,IDN_Conve rsion_Page_Set_ Handler)">
<table border=0>
<tr><td class="varName" >
<b>Open New Entry When Source Port Different</b>
</td>
<td class="varValue " id="varValue1" >
<input type="hidden" name="mibId_0" value="187">
<script language="JavaS cript1.2" type="text/javascript">
var187_0Object = new SelectBox("var1 87_0","varValue 1");
var187_0Object. add("enable","e nable");
var187_0Object. add("disable"," disable");
var187_0Object. setValue("disab le");
</script></td></tr>[/HTML]
SelectBox is defined in another javascript file, and the code goes like this:
[CODE=javascript]
function SelectBoxSetVal ue(value) {
options = this.sel.option s;
for (i=0;i<options. length;i++) {
if (options[i].value == value) {
this.sel.select edIndex = i;
}
}
}
function SelectBoxAdd(te xt,value)
{
ops = this.sel.option s;
for (i=0;i<ops.leng th;i++) {
if (ops[i].text == text) {
return;
}
}
o = document.create Element("OPTION ");
o.text = text;
o.value = value;
addoption(this. sel,o);
}
function SelectBox(name, parentId) {
this.sel = document.create Element("SELECT ");
this.sel.name = name;
this.sel.id = name;
if (parentId != null) {
this.par = document.getEle mentById(parent Id);
} else {
this.par = document;
}
this.add = SelectBoxAdd;
this.remove = SelectBoxRemove ;
this.setValue = SelectBoxSetVal ue;
this.par.append Child(this.sel) ;
}
[/CODE]
Can anyone give some pointers as to why this wouldn't work in Firefox?
Thanks in advance
Comment