[SOLVED] calling a javascript (image, onclick, global content)
Posted: Mon Feb 16, 2009 6:23 pm
Hello,
I have a javascript calendar and it works perfectly. When the page opens a lovely multi-select calendar is availble.
{global_content name='calculon'}
For testing, I have a hard coded an array which will highlight the chosen dates through the calendar's addDates() function.
{global_content name='add2'}
I am unsuccesfully trying to execute the global content block from a button image link onclick.
Please let me know if this is possible and how, or if there is a better way.
cheers
I have a javascript calendar and it works perfectly. When the page opens a lovely multi-select calendar is availble.
{global_content name='calculon'}
Code: Select all
<link rel="stylesheet" type="text/css" href="uploads/epoch_styles.css" />
{literal}
<__script__ type="text/javascript" src="uploads/epoch_classes.js"></__script>
<__script__ type="text/javascript">
var bas_cal,dp_cal,ms_cal;
window.onload = function () {
ms_cal = new Epoch('epoch_multi','flat',document.getElementById('multi_container'),true);
};
</__script>
{/literal}
<div id="multi_container"></div>
{global_content name='add2'}
Code: Select all
{literal}
<__script__ type="text/javascript" language="javascript"><!--
var date1 = new Date(2009,1,15) //feb 15, 2006
var date2 = new Date(2006,1,17) //feb 17, 2006
var myArray = new Array(date1,date2);
ms_cal.addDates(myArray); //add the dates and display them on the calendar!
</__script>
{/literal}
Please let me know if this is possible and how, or if there is a better way.
cheers