#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2009
    Posts
    111
    Rep Power
    16

    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);" }} );
    		
    	});
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2009
    Posts
    111
    Rep Power
    16
    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); }} );
  4. #3
  5. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,265
    Rep Power
    968
    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.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2009
    Posts
    111
    Rep Power
    16
    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

IMN logo majestic logo threadwatch logo seochat tools logo