Hi,
I have a script in one of my .asp pages which I think is written in
VBScript (I did not write it). I would like to know how to do the
following in Javascript.
Have a combo on my page which basically lists all the following
Tusdays & Thursdays dates, up to a set qty, i.e. 20 in the list.
E.g. todays date is 2nd August, so the combo would list 20 lines of:
Tusday 3rd August
Thursday 5th August
Tusday 10th August
Thursday 12 August
and so on for another 16 lines...
How is this possible ?
_______________ _______________ ____________
The code I have at the mo has been tweeked by myself, but I can only
get the combo to list the Tuesdays first, then all the Thursdays, not
all in date order.
_______________ _
<SCRIPT language='vbscr ipt'>
Sub Window_Onload
Dim TheDate
Dim Count
Dim Options
TheDate = Date + vbTuesday - WeekDay(Date)
TheDate2 = Date + vbThursday - WeekDay(Date)
If TheDate < Date Then TheDate = TheDate + 7
Set Options = Document.All.Da te.Options
For Count = 1 To 20
StrDate = "Tuesday " & Right("0" & Day(TheDate),2) & "/" &
Right("0" &_
Month(TheDate), 2) & "/" & Year(TheDate)
Options.Add Window.Option(S trDate,"for " & StrDate)
TheDate = TheDate + 7
Next
If TheDate2 < Date Then TheDate2 = TheDate2 + 7
Set Options = Document.All.Da te.Options
For Count = 1 To 20
StrDate2 = "Thursday " & Right("0" & Day(TheDate2),2 ) & "/" &
Right("0" &_
Month(TheDate2) ,2) & "/" & Year(TheDate2)
Options.Add Window.Option(S trDate2,"for " & StrDate2)
TheDate2 = TheDate2 + 7
Next
End Sub
</script>
_______________ _______________ _
Hope you can help ?
David
I have a script in one of my .asp pages which I think is written in
VBScript (I did not write it). I would like to know how to do the
following in Javascript.
Have a combo on my page which basically lists all the following
Tusdays & Thursdays dates, up to a set qty, i.e. 20 in the list.
E.g. todays date is 2nd August, so the combo would list 20 lines of:
Tusday 3rd August
Thursday 5th August
Tusday 10th August
Thursday 12 August
and so on for another 16 lines...
How is this possible ?
_______________ _______________ ____________
The code I have at the mo has been tweeked by myself, but I can only
get the combo to list the Tuesdays first, then all the Thursdays, not
all in date order.
_______________ _
<SCRIPT language='vbscr ipt'>
Sub Window_Onload
Dim TheDate
Dim Count
Dim Options
TheDate = Date + vbTuesday - WeekDay(Date)
TheDate2 = Date + vbThursday - WeekDay(Date)
If TheDate < Date Then TheDate = TheDate + 7
Set Options = Document.All.Da te.Options
For Count = 1 To 20
StrDate = "Tuesday " & Right("0" & Day(TheDate),2) & "/" &
Right("0" &_
Month(TheDate), 2) & "/" & Year(TheDate)
Options.Add Window.Option(S trDate,"for " & StrDate)
TheDate = TheDate + 7
Next
If TheDate2 < Date Then TheDate2 = TheDate2 + 7
Set Options = Document.All.Da te.Options
For Count = 1 To 20
StrDate2 = "Thursday " & Right("0" & Day(TheDate2),2 ) & "/" &
Right("0" &_
Month(TheDate2) ,2) & "/" & Year(TheDate2)
Options.Add Window.Option(S trDate2,"for " & StrDate2)
TheDate2 = TheDate2 + 7
Next
End Sub
</script>
_______________ _______________ _
Hope you can help ?
David
Comment