I'm having problem with the homepage calendar.  
Here is an link - http://clontarf.girlsacademy.com.au/
What I what to do is  - When the user clicks the date on the calendar, the page will go to the events page (go to news/events tab, scroll down to see the heading called "Events" under the test).
Below javascript  pointing to the wrong link. How can I fix the javascript so it points to the correct link?

function showEvents(date) {
rtn = "";
for (var i = 1; i < events.length; i++)
if(1900+date.getYear()==events[i][2] && 1+date.getMonth()==events[i][3] && date.getDate()==events[i][4])
rtn += events[i][1]+", \r\n";
if(rtn == "") return [false, "", ""];
return [true, '',rtn];

function callEvent(dateText, inst) {
dateText2 = dateText.split("/"); dateText2 = dateText2[2]+"-"+dateText2[0]+"-"+dateText2[1];

$( "#datepicker" ).datepicker({
beforeShowDay: showEvents,
onSelect: callEvent

Any help would be appreciated?

Recommended Answers

All 5 Replies

Line 12 of your code.


You could put in front of it what ever the correct url is.



I couldn't tell the exact change because I am still not sure where you are trying to get it to go.

Hey pixelsoul,

I'm trying to make a point to http://www.girlsacademy.com.au/news1.php?id=Event-Test-59



change to

document.location.href="news1.php?=id="+ $(inst).attr('title').match(/\d+$/);

Is there anything wrong with this script?

The only thing I can see that looks to be a problem is the "=" after the beginning of the query string.

document.location.href="news1.php?id="+ $(inst).attr('title').match(/\d+$/);

Is there any other way to fix the error? Maybe change "=" to "-"??

What error are you getting? You didn't mention any error before.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.