July 27th, 2012, 08:57 AM
-
Jquery datepicker with coldfusion.navigate
Hey,
I'm tryig to use coldfusion.navigate to refresh a div when a date from my date picker is selected. I've got the datepicker submitting a url string and refreshing my div. My questions are...
1. is this the proper way to do this? i mean it works, it refreshes the div so it's not totaly wrong.
2. How can i pass the dateText in the variable date in the url?
I've posted this is the JS section as well.
Code:
$( "#datepicker" ).datepicker({
dateFormat : 'dd-M-yy',
defaultDate: mydatefinal,
onSelect: function(dateText, inst) { window.location.href = "javascript:ColdFusion.navigate('calendarout.cfm?date=','calendar-right',mycallBack,myerrorhandler);" }} );
});
July 27th, 2012, 01:23 PM
-
I figured it out. I have a very poor grasp of JS. This is my first time writing my own scripts and using JQUERY.
Code:
onSelect: function(dateText, inst) { javascript:ColdFusion.navigate('calendarout.cfm?date=' +dateText ,'calendar-right',mycallBack,myerrorhandler); }} );
July 27th, 2012, 01:32 PM
-
If you're using jQuery, my advice would be to just use jQuery for any client-side logic and AJAX. It's far more versatile than what is built into CF. What's in CF is meant for people who need very basic behavior and can't or won't bring an external framework to bear.
July 27th, 2012, 03:12 PM
-
Originally Posted by kiteless
If you're using jQuery, my advice would be to just use jQuery for any client-side logic and AJAX. It's far more versatile than what is built into CF. What's in CF is meant for people who need very basic behavior and can't or won't bring an external framework to bear.
I didn't know i could achieve these results with only jQuery. I'm going to have to look into this further.
Thanks,
DSFX