Question

I'm trying to get a javascript event to reload a page when I change a date using calendar control, but the page won't reload. Any idea how to do this?

this is what i have right now

<input type="text" name="start_date" onFocus="showCalendarControl(this);" value="#FORM.start_date#" onchange="changeDateReload(this.value);" />


function changeDateReload(newDate){
    <cfoutput>
        window.location("editBooking.cfm?booking_id='#URL.booking_id#'&req_mon={ts ''newDate' 00:00:00'}&req_time='#URL.req_time#'&req_room_id='#URL.req_room_id#'");   
    </cfoutput>
}   
Was it helpful?

Solution

window.location isn't a function, but an object. Use

window.location = newLocation;

(See MDC and W3C spec)

OTHER TIPS

i don't know whats the "<cfoutput>" tag means in your script code.

Write the script function like that:

<script language="javascript" type="text/javascript">
        function changeDateReload(newDate){
            window.location = "editBooking.cfm?booking_id='#URL.booking_id#'&req_mon={ts ''newDate' 00:00:00'}&req_time='#URL.req_time#'&req_room_id='#URL.req_room_id#'";   
        }   
    </script>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top