Hi, I am trying to create dynamic list boxes using the onChange event
handler.
Basically what I have here is a little function called NumberOfDays
which returns the number of days in a given month in a given year. I
then have an html select box <select> that I am populating with the
number of days returned from the function. Essentially, this
subroutine works. For instance, if I select January of 2003, then it
populate my select box with numbers 1-31 but the problem is if it gets
called a second time, it doens't clear the original data. So if I
select January of 2003, and then I select January of 2002, the select
box will be filled with 1-31,1-31

Here is my subroutine:

Sub end_year_OnChange
days=NumberOfDays(form1.end_month.Value, form1.end_year.Value)
for i=1 to days
Set Opt = document.createElement("OPTION")
Opt.text = i
Opt.value = i
Opt.ID = i
form1.end_day.Add Opt
Set Opt = Nothing
Next
End Sub

Re: using createElement with VBScript by Ray

Ray
Tue Jul 22 20:38:46 CDT 2003

Try posting to a client-side group such as
microsoft.public.scripting.vbscript. This group is about server-side
scripting.

Ray at home

--
Will trade ASP help for SQL Server help


"Jeremy" <okanok_man@hotmail.com> wrote in message
news:3a156897.0307221327.1f72bf4c@posting.google.com...
> Hi, I am trying to create dynamic list boxes using the onChange event
> handler.