Hi All
What I am trying to do is output a message "Holiday" immediately after entering a date using the following JavaScript.
It last line will eventually be replaced with
There will obviously also be some code to check the date, but first I need to get some variables from ASP. I have set these up using the following
My problem is reading iNoHols, dStartHols and dEndHols in the JavaScript. You can see I have tried to get iNoHols in the code above and display it in the last line. I have googled this for days and var noHols = "<%=iNoHols%>" seems to be the way to go, but no joy. Can you see what I am doing wrong?
Thanks
What I am trying to do is output a message "Holiday" immediately after entering a date using the following JavaScript.
Code:
<script type="text/javascript">
var noHols = "<%=iNoHols%>"
function datePickerClosed(dateField) {
var HolArray = new Array();
document.getElementById("DateMess").value = noHols;
}
</script>
Code:
document.getElementById("DateMess").value = "Holiday;
Code:
dim dStartHols(100), dEndHols(100)
holsSql = "SELECT Start_Date, End_Date from lawn_holidays " &_
"Where UserID='" & Request.Cookies("userid") & "' " &_
"AND Van=" & iVan
response.write holsSql & "<BR>"
set holsRS=DBconn.execute(holsSql)
iNoHols=-1 'because arrays start from zero
if holsRS.BOF and holsRS.EOF then
response.write "empty" & "<br>"
else
response.write "Full" & "<br>"
do until holsRS.eof
iNoHols = iNoHols + 1
dStartHols(iNoHols) = holsRS("Start_Date")
dEndHols(iNoHols) = holsRS("End_Date")
holsRS.movenext
loop
'because arrays start from zero, if 1 holiday, then will have value 0
end if
Thanks