I want to add the datepicker example to a form and have it show and hide when a field has focus and loses focus.
So far I haven't been able to figure out how to show and hide the picker dynamically.
I tried adding this code in the FrameworkPropertyChanged handler.
Case "Visible" if ControlAvailableInBrowser then if value then ExecuteJavaScript("$('#" + Me.ControlID + "').datepicker('_show');") else ExecuteJavaScript("$('#" + Me.ControlID + "').datepicker('_hide');") end if end if
The code executes when expected but produces this error in the browser.
Could not execute returned javascript: 'undefined' is not an object (evaluating '$.datepicker["_"+a+"Datepicker"].apply') Source: $('#AJCvs7iy').datepicker('_show');
$('#AJCvs7iy').datepicker('_show');
RS.comm.ajax.begin();
I don't do a lot of javascript, but it seems from the error message that the code isn't executed directly as it would be in a static html page. Looking in the safari inspector I can see there is a div with the id shown in the source line, so I'm not sure why the object is undefined. How can I trace this down.
|