Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > using createElement with VBScript

Thread Tools

using createElement with VBScript

Posts: n/a
Hi, I am trying to create dynamic list boxes using the onChange event
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
End Sub
Reply With Quote
Ray at
Posts: n/a
Try posting to a client-side group such as
microsoft.public.scripting.vbscript. This group is about server-side

Ray at home

Will trade ASP help for SQL Server help

"Jeremy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Hi, I am trying to create dynamic list boxes using the onChange event
> handler.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
element not defined when using "createElement" Javascript 5 02-23-2007 01:59 AM
calculations using createElement input text boxes in a table Javascript 2 12-06-2006 07:28 PM
DOM CreateElement? Arpan ASP .Net 3 08-25-2006 12:12 PM
using document.createElementNS or document.createElement James Black Javascript 10 05-25-2006 11:15 AM
calculating in table made by createElement and appendChild kie Javascript 25 10-07-2003 11:38 AM