Page 1 of 1

Possible error in updated monthlyrecordT.htm (build 1089)

Posted: Sat 05 Apr 2014 3:51 pm
by martinu
I notice that one of the changes in going from Build 1086 to 1089 (so it may have happened for any build in between) is that you offer the possibility of presetting the monthlyrecord.htm page to display initially the data relating to the current month, rather than having it always default to January.

However I can't make it work and my knowledge of Javascript isn't up to diagnosing why.

In the <script></script> section you now call changeData(+'<#month>' - 1); (yes, I have removed the // which was commenting-out the line!) which evaluates to changeData(+'04' - 1); in monthlyrecord.htm at the moment. However the page still initially displays January's data.

I wondered whether the syntax of the expression was wrong so I tried an explicit changeData(4); instead and even that doesn't work. This makes me wonder whether the function is even being called at that point. The function does work if it's called by pressing one of the Month buttons - the <input type="button" value="Mar" onclick="changeData(2)"/> code.

Any suggestions?

Re: Possible error in updated monthlyrecordT.htm (build 1089

Posted: Sat 05 Apr 2014 4:05 pm
by steve
Yes, I added the commented-out code, but I forgot to move the script to the end of the document (just before the </body> tag).

Re: Possible error in updated monthlyrecordT.htm (build 1089

Posted: Sat 05 Apr 2014 5:26 pm
by martinu
Thanks. That works perfectly.

For the benefit of anyone else who may see this thread and wants to make the code work (before you release it in the next build) the edits that you make to monthlyrecordT.htm are:

1) remove lines 116-118

// If you want the page to display the current month when it opens,
// remove the "//" from the start of the next line
//changeData(+'<#month>' - 1);


2) insert the following lines immediately before the </body> line (the last-but-one line)

<script>
// If you want the page to display the current month when it opens,
// remove the "//" from the start of the next line
changeData(+'<#month>' - 1);
</script>