displaying calender dates in green

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gubbachchi
    New Member
    • Jan 2008
    • 59

    displaying calender dates in green

    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.p hp" method="POST">
    Your id : <input type="textbox" id="idno" name="idno">
    Chosse date : <a STYLE="text-decoration: none" onmouseover="wi ndow.status='Da te Picker';return true;" onmouseout="win dow.status='';r eturn true;" href="javascrip t:show_calendar ('myform.date_i d')" >

    <IMG height=21 src="calendar.g if" 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
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    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]

    Comment

    • gubbachchi
      New Member
      • Jan 2008
      • 59

      #3
      Originally posted by markusn00b
      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

      Comment

      Working...