Hello,
I need help with a date processing function. I have a form where my customers will put in a date (in format mm/dd/yy). But I want that date to be used to update another field on the form with just the day of the week only.
I've tried this:
<script type="text/javascript">
var d=new Date()
var weekday=new Array("Sunday","Monday",
"Tuesday", "Wednesday", "Thursday",
"Friday","Saturday"
</script>
And then calling the following the following during an onblur:
document.estform.startingdayofweek.value=weekday[d.getDay(document.estform.startdate.value)]
But this just keeps returning today's weekday in the startingdayofweek textbox.
Can someone please let me know what I am doing wrong here or if there is a more efficient way to do this, please let me know?
Thanks!
I need help with a date processing function. I have a form where my customers will put in a date (in format mm/dd/yy). But I want that date to be used to update another field on the form with just the day of the week only.
I've tried this:
<script type="text/javascript">
var d=new Date()
var weekday=new Array("Sunday","Monday",
"Tuesday", "Wednesday", "Thursday",
"Friday","Saturday"
</script>
And then calling the following the following during an onblur:
document.estform.startingdayofweek.value=weekday[d.getDay(document.estform.startdate.value)]
But this just keeps returning today's weekday in the startingdayofweek textbox.
Can someone please let me know what I am doing wrong here or if there is a more efficient way to do this, please let me know?
Thanks!