By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,664 Members | 1,643 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,664 IT Pros & Developers. It's quick & easy.

displaying calender dates in green

P: 59
Hi all,

How will I change the color of the dates in the javascript calendar which already has some event entered for it. Like I have a form where the user enters the id and selects the date from calendar and leaves a comment for that date. This data will be stored in mysql database.

How can I change the color of dates in calendar so that if the user has already entered some comment for that then that date should become green color. How can I do this. Can anybody help me.

Here is the source code

form1.html
[HTML]<script type="text/javascript" src="date-picker.js"></script>
<form name="myform" action="test1.php" method="POST">
Your id : <input type="textbox" id="idno" name="idno">
Chosse date : <a STYLE="text-decoration: none" onmouseover="window.status='Date Picker';return true;" onmouseout="window.status='';return true;" href="javascript:show_calendar('myform.date_id')" >

<IMG height=21 src="calendar.gif" width=30 border=0></a>
<input type="textbox" class="textBox" type="text" readonly name="date_id" id="date_id" size="10">
Comments : <input type="textbox" id="comment" name="comment">
<input type="submit" value="click">
</form>[/HTML]

With regards
Feb 18 '08 #1
Share this Question
Share on Google+
2 Replies


Markus
Expert 5K+
P: 6,050
Assuming you save the date into the databse with the comment, you could use an if statement whether the date has a comment..
something like:
[php]
if($_row['commented'] == "yes")
{
echo "<span style=\"color: green;\">$_row['date']</span>";
}
[/php]
Feb 18 '08 #2

P: 59
Assuming you save the date into the databse with the comment, you could use an if statement whether the date has a comment..
something like:
[php]
if($_row['commented'] == "yes")
{
echo "<span style=\"color: green;\">$_row['date']</span>";
}
[/php]

Thanks for your reply.

I tried it, but it is not working. I checked if ($comment=="yes") and tried the code
echo "<span style=\"color: green;\">$_row['date']</span>";

Can you give me some information on this, if possible.

With regards
Feb 18 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.