/    Sign up×
Community /Pin to ProfileBookmark

Javascript Calendar

Hello Everyone,

I am new to using Javascript and I have a calender which I am trying to modify so that when the page loads, the system checks the day and if it is the next day, it moves the same a href link information to that day.
I know that I need a varaible either global or local, but I have been unable to get the correct syntax. I currently have to manually change the day in dayinfo and then move the information to that day. The code I am using currently is as follows:

<html>
<head>
<title>Calendar</title>
<script language=javascript type=”text/javascript”>

dayInfo = new Array

dayInfo[26] =”Classes Coming: Sign-up Now”

function showInfo(thisDay) {
document.calendar.dateInfo.value = dayInfo[thisDay]

}
</script>

</head>

<body>
<table cellspacing=2 cellpadding=2 align=left name = “calendar”>
<tr>
<th colspan=7>April 2005</th>
<td rowspan=6>&nbsp;&nbsp;</td>
</tr>
<tr align=right>
<td colspan=6></td>
<td>2</td>

</tr>
<tr align=right>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>

</tr>
<tr align=right>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
<td>15</td>
<td>16</td>

</tr>
<tr align=right>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
<td>22</td>
<td>23</td>

</tr>
<tr align=right>
<td>24</td>
<td>25</td>
<td><a href=”javascript:showInfo(26)”>26</a></td>
<td>27</td>
<td>28</td>
<td>29</td>
<td>30</td>
</tr>

</table>
<form name=”calendar”>
<textarea rows=7 cols=20 name=”dateInfo”
readonly wrap>
Click on any underline day to see what’s
happening
</textarea>
</form>
</body>

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@TheBearMayApr 26.2005 — Off the top of my head:

<i>
</i>
var today = new Date();
....
dayInfo(today.getDate())=....
Copy linkTweet thisAlerts:
@ginaannauthorApr 29.2005 — Thanks. I will give it a try
×

Success!

Help @ginaann spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...