Getting Code to Run
Posted: Sat Feb 14, 2009 3:03 pm
I have some javascript/AJAX that runs a php script to output a coach schedule into a html table. It takes the value that is in the 'date' text box and brings out the matching data.
The code works when it is called by a seperate 'get schedule' button click.
However what I want to happen is - the user select a date using a calendar, this date be entered into the textbox, and then upon the onChange of this textbox containing the date the javascript be called.
However my onChange is only working when a user manually enters a date.
Or after the user clicks the calendar, the problem with this is that it would use the date currently in the date textbox when running the getschedule() whereas I want it to use the date the user is selecting after selecting from the calendar
The GetSchedule is the last to be called, yet is still wont pass in the newly selected date to the GetSchedule code? Is there some php I could write to sort this?
The code works when it is called by a seperate 'get schedule' button click.
However what I want to happen is - the user select a date using a calendar, this date be entered into the textbox, and then upon the onChange of this textbox containing the date the javascript be called.
However my onChange is only working when a user manually enters a date.
Or after the user clicks the calendar, the problem with this is that it would use the date currently in the date textbox when running the getschedule() whereas I want it to use the date the user is selecting after selecting from the calendar
Code: Select all
<input type="text" name="date" id="date" size=25 onChange="GetSchedule()">
<a href="#" onClick="cal18.select(document.forms[0].date,'calendar','MM/dd/yyyy'); GetSchedule();" name="calendar" id="calendar" style="border:none">
<img src="images/calendar.png" border="0" align="top"></a>