How to display a CalendarExtender from your js code without using it as an extender?
Is there any way to display a Calendar Extender popup without using it the traditional way? and the also grabbing the value selected?
Some code that I made up to make it more clear:
<table>
<tr>
<td><input type="text"/></td>
<td><input type="text"/></td>
<td><input type="text"/></td>
<td><input type="text"></td>
</tr>
</table>
$('table :text').focus(function(){
displayTheCalendar();
开发者_JS百科 });
//PSEUDOCODE!!!
function onDateSelected(e){
$(this || event.srcElement || etc..).val(e.dateSelected);
}
I guess I need some kind of 'hack' here for the js of that Calendar.
PS: I must use the extender or any control that looks and feel like the extender.
I went to the source and found that it is emitting the following javascript so I tried to just output that but it is giving me a javascript error. Not sure why it doesn't work, but it's a start.
Sys.Application.initialize();
Sys.Application.add_init(function() {
$create(AjaxControlToolkit.CalendarBehavior, {"format":"MM/dd/yyyy","id":"ctl00_ctl00_MainContent_Grid_ctl14_calendarb63eeafcf459"}, null, null, $get("ctl00_ctl00_MainContent_Grid_ctl14_b63eeafcf459"));
});
精彩评论