This is a multi-part message in MIME format.

------=_NextPart_000_0006_01C703E3.22966690
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I have a list box filled with entries. On a button click I want to fill =
the different entries in the same list box. How do I refresh it with new =
entries. I tried innerHTML but did not work for me.

Thanks in advance

------=_NextPart_000_0006_01C703E3.22966690
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>I have a list box filled with =
entries.&nbsp; On a=20
button click I want to fill the different entries in the same list box. =
How do I=20
refresh it with new entries. I tried innerHTML but did not work for=20
me.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks in advance</FONT></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0006_01C703E3.22966690--

Re: Select control DHTML by abcd

abcd
Thu Nov 09 11:44:59 CST 2006

This is a multi-part message in MIME format.

------=_NextPart_000_0022_01C703E3.BAB0D8C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Sample code I am trying as below. Here, I want to replace the list box =
with different entries on the button click.=20

<HTML>
<head>
<script language=3D"javascript">
function Test()
{
//var oldinnerHTML =3D document.frm.sel.innerHTML
document.frm.sel.innerHTML=3D "<option>111</option><option>222</option>"
}
</script>
</head>

<form name=3D"frm">
<select name=3D"sel">
<option>aaa</option>
<option>bbb</option>
<option>ccc</option>
<option> ddd</option>
</select>
</form>
<input type=3D"Button" name=3D"btn" value=3D"press" onclick=3D"Test()">
</html>

"abcd" <abcd@abcd.com> wrote in message =
news:uQ9KzYCBHHA.3536@TK2MSFTNGP03.phx.gbl...
I have a list box filled with entries. On a button click I want to =
fill the different entries in the same list box. How do I refresh it =
with new entries. I tried innerHTML but did not work for me.

Thanks in advance

------=_NextPart_000_0022_01C703E3.BAB0D8C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Sample code I am trying as below. Here, =
I want to=20
replace the list box with different entries on the button click. =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" color=3D#800000=20
size=3D2>&lt;HTML&gt;<BR>&lt;head&gt;<BR>&lt;script=20
language=3D"javascript"&gt;<BR>function Test()<BR>{<BR>//var =
oldinnerHTML =3D=20
document.frm.sel.innerHTML<BR>document.frm.sel.innerHTML=3D=20
"&lt;option&gt;111&lt;/option&gt;&lt;option&gt;222&lt;/option&gt;"</FONT>=
</DIV>
<DIV><FONT face=3D"Courier New" color=3D#800000 size=3D2>}</FONT><FONT=20
size=3D2><BR><FONT face=3D"Courier New"=20
color=3D#800000>&lt;/script&gt;<BR>&lt;/head&gt;</FONT></FONT></DIV>
<DIV><FONT size=3D2><BR><FONT face=3D"Courier New" =
color=3D#800000>&lt;form=20
name=3D"frm"&gt;<BR>&lt;select=20
name=3D"sel"&gt;<BR>&lt;option&gt;aaa&lt;/option&gt;<BR>&lt;option&gt;bbb=
&lt;/option&gt;<BR>&lt;option&gt;ccc&lt;/option&gt;<BR>&lt;option&gt;=20
ddd&lt;/option&gt;<BR>&lt;/select&gt;<BR>&lt;/form&gt;<BR>&lt;input=20
type=3D"Button" name=3D"btn" value=3D"press"=20
onclick=3D"Test()"&gt;<BR>&lt;/html&gt;</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"abcd" &lt;<A href=3D"mailto:abcd@abcd.com">abcd@abcd.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:uQ9KzYCBHHA.3536@TK2MSFTNGP03.phx.gbl">news:uQ9KzYCBHHA.3536=
@TK2MSFTNGP03.phx.gbl</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>I have a list box filled with =
entries.&nbsp; On a=20
button click I want to fill the different entries in the same list =
box. How do=20
I refresh it with new entries. I tried innerHTML but did not work for=20
me.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks in advance</FONT></DIV>
<DIV>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0022_01C703E3.BAB0D8C0--


Re: Select control DHTML by mayayana

mayayana
Thu Nov 09 18:14:01 CST 2006

It's awkward and not what you'd
expect. The DOM model treats each
OPTION as an object.

I usually do it by starting with an empty
SELECT. Then you can dynamically clear
it and re-populate it. The sub below would
repopulate a SELECT with an array of strings:


'-- where "box" is the SELECT.
Sub ResetSelect(ArrayList)
Dim Opt, i2
box.length = 0 '--clear it.

For i2 = o to ubound(ArrayList)
Set Opt = document.createElement("OPTION")
Opt.text = ArrayList(i2)
box.add Opt
Set Opt = Nothing
Next
End Sub

You can also use box.value if you want
to, giving you 2 variables per OPTION.

I didn't test the above to make sure that
it can take the array value directly. If not
you'd need to do:

s = ArrayList(i2)
Opt.text = s
etc.

-----------------
I have a list box filled with entries. On a button click I want to fill the
different entries in the same list box. How do I refresh it with new
entries. I tried innerHTML but did not work for me.

Thanks in advance