I have a function written in VBScript that I need now in JavaScript. But I don't know JavaScript and I need it urgent so no time to study. If somebody can help me and just write it for me in JavaScript it would be great.
<script LANGUAGE="VBScript">
Function IsMyFormValid
if CC.date1.value <> Empty then
IsMyFormValid=true
else
IsMyFormValid= false
alert "You didn't enter a date."
exit function
end if
if CC.Hours.value <> Empty then
IsMyFormValid=true
else
IsMyFormValid= false
alert "You didn't enter the hours."
exit function
end if
if CC.Minutes.value <> Empty then
IsMyFormValid=true
else
IsMyFormValid= false
alert "You didn't enter the minutes."
exit function
end if
if CC.Hours.value<24 then
IsMyFormValid=true
else
IsMyFormValid= false
alert "The hours that you have entered are incorrect."
exit function
end if
if CC.Minutes.value<60 then
IsMyFormValid=true
else
IsMyFormValid= false
alert " The minutes that you have entered are incorrect."
exit function
end if
vDate=Date()
vDate1=Date() + 7
vUserDate=Cdate(CC.date1.value)
if vUserDate < vDate then
IsMyFormValid= false
alert "You must enter a date between: " & vDate & " and " & vDate1 & " ."
exit function
else
IsMyFormValid=true
end if
if vUserDate > vDate1 then
IsMyFormValid= false
alert "You must enter a date between: " & vDate & " and " & vDate1 & " ."
exit function
else
IsMyFormValid=true
end if
CC.DataAction.value="True"
end Function
</script>
<script LANGUAGE="VBScript">
Function IsMyFormValid
if CC.date1.value <> Empty then
IsMyFormValid=true
else
IsMyFormValid= false
alert "You didn't enter a date."
exit function
end if
if CC.Hours.value <> Empty then
IsMyFormValid=true
else
IsMyFormValid= false
alert "You didn't enter the hours."
exit function
end if
if CC.Minutes.value <> Empty then
IsMyFormValid=true
else
IsMyFormValid= false
alert "You didn't enter the minutes."
exit function
end if
if CC.Hours.value<24 then
IsMyFormValid=true
else
IsMyFormValid= false
alert "The hours that you have entered are incorrect."
exit function
end if
if CC.Minutes.value<60 then
IsMyFormValid=true
else
IsMyFormValid= false
alert " The minutes that you have entered are incorrect."
exit function
end if
vDate=Date()
vDate1=Date() + 7
vUserDate=Cdate(CC.date1.value)
if vUserDate < vDate then
IsMyFormValid= false
alert "You must enter a date between: " & vDate & " and " & vDate1 & " ."
exit function
else
IsMyFormValid=true
end if
if vUserDate > vDate1 then
IsMyFormValid= false
alert "You must enter a date between: " & vDate & " and " & vDate1 & " ."
exit function
else
IsMyFormValid=true
end if
CC.DataAction.value="True"
end Function
</script>