I'm trying to view it in IE6 <script type="text/javascript"> function woikit() { var months = new Array("January","February","March","April","May","June","July","August","September","October","November","December"); var days = new Array("Sunday","Monday","Tuesday","Wednsday","Thursday","Friday","Saturday"); var c1 = new Date(); var c2 = new Date(); alert("got here") c1.setmonth(document.form1.dat1.value); c1.setday(document.form1.dat2.value); c1.setyear(document.form1.dat3.value); alert(c1); } </script> Code (markup): the alert "got here" fires, so I know i made it from the submit button to the function. but alert(c1) does not work. Am I failing to see the alert, or failing to get the input data into the date vars? I use this button to start it; <input type="submit" name="Submit" value="Submit" onClick="woikit()"> Code (markup): I appreciate your time and help....
c1.setmonth(document.form1.dat1.value); c1.setday(document.form1.dat2.value); c1.setyear(document.form1.dat3.value); Code (markup): Are those supposed to be "date" instead of "dat"?
The method names are case sensitive c1.[B]setMonth[/B](document.form1.dat1.value); c1.[B]setDay[/B](document.form1.dat2.value); c1.[B]setYear[/B](document.form1.dat3.value); Code (markup):
I got this form this url http://richardbowles.tripod.com/javascript/section8/lesson8.htm And this is borne out in Dreamweaver where setMonth and SetYear are given a green font color indicating keywords, and SetDay remains unchanged. I used SetMonth - getDay - setYear and got a date and time value back in the alert. Thank you so much for your input. Next I will try to subtract dates, and assign different hotel rates to weekday and weeknights, then add up the values and average them Good clean fun.