I think the function is working correctly. When I code it this way:
Code: Select all
calEnd.addDisabledDates(null,"e;06/15/05"e;);
The dates up through June 15 are properly disabled. Here's the first bit of code where the start date gets set:
Code: Select all
echo '<td>
<script language="JavaScript" id="jsStart">
var now = new Date();
var calStart = new CalendarPopup("caldiv");
calStart.addDisabledDates(null,"'.$start_limit.'");
calStart.addDisabledDates("'.$end_limit.'",null);
calStart.setDisabledWeekDays(0,6);
</script>
First Day: <input type="text" name="dateStart" value="'.$dateStart.'" size="8">
<a href="#" onClick="calStart.select(document.forms[\'adder\'].dateStart,\'anchorStart\',\'MM/dd/yy\');
return false;" name="anchorStart" id="anchorStart">
<img src="images/calendar.gif" width="16" height="15" border="0" alt="" align="top" vspace="3"/></a>
</td>';
$start_limit and $end_limit are PHP variables I set earlier in the page. They're working perfectly.
All of the onClick stuff in the anchor tag goes to the external JavaScript file, which is the heart of the popup calendar script. It's the value that this script inserts into the input field that I want to use in the second instance of the popupcalendar.
Almost forgot to add that I tried the alert(date1) suggestion and got zip. I assume this means I'm not passing any value in that variable. Then again, it could be the way this script works with the actual calendar popping up in a tiny window. Earlier I tried:
Nothing happended then either.
Any ideas? Or should I point you to the javascript source for this popup calendar?
Thanks again!
++++++UPDATE+++++
Actually, the alert box does pop up as soon as the page loads, but the value is not displayed. But then I'm thinking that makes perfect sense since date1 won't get a value until after the user selects a start date. And that's the part I'm not sure is possible. Can I grab the value of that input field
after a start date is selected? Can JavaScript do that?