Forum Moderators: open

Message Too Old, No Replies

js

         

franches

1:52 am on Nov 4, 2004 (gmt 0)

10+ Year Member



hi,
i would like to ask help from you js experts. I am trying to write this in js but i am having a hard time. i would really appreciate if you could help me with this.


<script language="vbscript">
<!--
filMonth = Month(Now)
filYear = Year(Date)

document.ViewForm.FilterMonth.value = filMonth
document.ViewForm.FilterYear.value = filYear
document.ViewForm.MonthChoice.value = filMonth
document.ViewForm.YearChoice.value = filYear
leapyearFilter = filYear mod 4
if document.ViewForm.MonthChoice.value = 2 then
if leapyearFilter = 0 then
dateEndDay = 29
elseif leapyearFilter > 0 then
dateEndDay = 28
end if
end if
if document.ViewForm.FilterYear.value = "2000" then
document.ViewForm.YearChoice.value = "00"
elseif document.ViewForm.FilterYear.value = "2001" then
document.ViewForm.YearChoice.value = "01"
elseif document.ViewForm.FilterYear.value = "2002" then
document.ViewForm.YearChoice.value = "02"
end if
if document.ViewForm.MonthChoice.value = "1" or + _
document.ViewForm.MonthChoice.value = "3" or + _
document.ViewForm.MonthChoice.value = "5" or + _
document.ViewForm.MonthChoice.value = "7" or + _
document.ViewForm.MonthChoice.value = "8" or + _
document.ViewForm.MonthChoice.value = "10" or + _
document.ViewForm.MonthChoice.value = "12" then
document.ViewForm.EDay.value = "31"
elseif document.ViewForm.MonthChoice.value = "2" then
document.ViewForm.EDay.value = dateEndDay
elseif document.ViewForm.MonthChoice.value = "4" or + _
document.ViewForm.MonthChoice.value = "6" or + _
document.ViewForm.MonthChoice.value = "9" or + _
document.ViewForm.MonthChoice.value = "11" then
document.ViewForm.EDay.value = "30"
end if
document.ViewForm.onStartYear.value = document.ViewForm.MonthChoice.value &"/1/"& document.ViewForm.YearChoice.value
document.ViewForm.onEndYear.value = document.ViewForm.MonthChoice.value &"/"& document.ViewForm.EDay.value &"/"& document.ViewForm.YearChoice.value
document.ViewForm.StartYear.value = document.ViewForm.MonthChoice.value &"/1/"& document.ViewForm.YearChoice.value
document.ViewForm.EndYear.value = document.ViewForm.MonthChoice.value &"/"& document.ViewForm.EDay.value &"/"& document.ViewForm.YearChoice.value
document.ViewForm.comStartYear.value = filMonth &"/1/"& filYear
document.ViewForm.comEndYear.value = filMonth &"/"& document.ViewForm.EDay.value &"/"& filYear

document.ViewForm.FinalDateNow.value = formatdatetime(document.ViewForm.DateNowValue.value,2)
document.ViewForm.FinalEndDateNow.value = formatdatetime(document.ViewForm.EndDateNowValue.value,2)
-->
</script>

Bernard Marx

7:50 am on Nov 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



* The code is VBScript (not Javascript)
* What's wrong with the code?
* What do you want it to do?

franches

2:56 am on Nov 5, 2004 (gmt 0)

10+ Year Member



i want to write this vb code in js. anyways, i've already got the code. thanks for replying.