function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NM AdminNM Admin 

Two actions on a button click in visual force page

Hello,

Need suggestions in the below requirement:
I have custom object
'Location' using this object i have a requirement.
I have datepicker on vf page and a button 'Go' when I select date from date picker and click on the Go button I want to display records created in the selected date in the table and in the bellow of the table want to display rout map of the locations using javascript.

for this I'm calling a method on change of the datepickers event in which I have written some vf remoting to fetch salected dates records. And onclick on the Go button calling action method of the apex controller to display table on the vf page.

Can anybody help me in this:
I want to run vf remoting on click on the 'Go' button and also want to run apex controller method to display table in the vf page.
On onchange event its giving me error "Unable to convert date '{0={}, context={}, length=1}' to Apex type Date."

Please let me know how to overcome with this error.

Here is my code 

var x;
                    j$ = jQuery.noConflict();
                    
                    x = j$(document).ready(function() 
                                       {
                                           j$( "#d" ).datepicker(
                                               {
                                                   defaultDate: "+1w",
                                                   changeMonth: true,
                                                   changeYear: true,
                                                   numberOfMonths: 1,
                                                   dateFormat:"mm-dd-yy",
                                                   altField: "#event_start_date_alternate",
                                                   altFormat: "yy-mm-dd",
                                                   showAnim: "slide"
                                               })
                                       });
                    

                    
                    alert('In TestMap=>');
                    //var x = document.getElementById('d').value;
                    console.log('x-->'+x);
                    alert('x=>'+x);
                    Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.TabularReport.findAll}',x,function(result, event){
                                         
                                             );




Welcome to your suggestions!

Thanks,
Nilesh