Create calendardateselect from javascript
- by 99miles
Not sure why I can't figure this out. When a user makes a selection, a javascript method is called, at which point I want to add a calendardateselect to an existing div tag from the javascript.
According to the docs, it seems like this should work:
var a = new CalendarDateSelect( document.getElementById("date_area"), {embedded:true, year_range:10} );
$('date_area').insert(a);
... or maybe this....
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
var tn = document.createTextNode("new CalendarDateSelect( $(this).previous() )");
newScript.appendChild(tn);
$('date_area').insert(newScript);
http://code.google.com/p/calendardateselect/wiki/JavascriptDocumentation
But neither of them are working. I feel like I've tried everything.
Ideas?