phpBBHacks.com - Topic Calendar: JavaScript error under IE
Community management insight at ManagingCommunities.com
StatsForums Home   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in
FAQFAQ   SearchSearch   MemberlistMemberlist   TutorialsTutorials   ContactContact Us
Username:    Password:
Remember Me?    
   I Lost My Password!
Bookmark and Share
Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 2 Hack Support
 See a User Guidelines violation? Please contact us.
Author Message

sbourdon
Not So New User

Joined: 30 Oct 2005
Posts: 77

PostPosted: August 16th 2010, 8:15 am    Post subject: Topic Calendar: JavaScript error under IE Reply with quote

Hello,

The Topic Calendar MOD returns a JavaScript error under Internet Explorer when clicking on "Today" to populate today's date in the "Calendar event" dropdown boxes...



The code is as follows:

TPL file:
Code:
<script language="JavaScript">todaysdate = new Date();</script>

<a href="javascript:void()" class="genmed" onClick="document.post.topic_calendar_day.value=todaysdate.getDate();document.post.topic_calendar_month.value=todaysdate.getMonth()+1;document.post.topic_calendar_year.value=todaysdate.getFullYear();" />{L_TODAY}</a>


PHP file:
Code:
      // day list
      $s_topic_calendar_day = '<select name="topic_calendar_day">';
      for ($i=0; $i <= 31; $i++)
      {
         $selected = ( intval($day) == $i) ? ' selected="selected"' : '';
         $s_topic_calendar_day .= '<option value="' . $i . '"' . $selected . '>' . ( ($i == 0) ? ' -- ' : str_pad($i, 2, '0', STR_PAD_LEFT) ) . '</option>';
      }
      $s_topic_calendar_day .= '</select>';

      // month list
      $s_topic_calendar_month = '<select name="topic_calendar_month">';
      for ($i=0; $i <= 12; $i++)
      {
         $selected = ( intval($month) == $i ) ? ' selected="selected"' : '';
         $s_topic_calendar_month .= '<option value="' . $i . '"' . $selected . '>' . $months[$i] . '</option>';
      }
      $s_topic_calendar_month .= '</select>';

      // year list
      $s_topic_calendar_year = '<select name="topic_calendar_year">';

      $selected = empty($year) ? ' selected="selected"' : '';
      $s_topic_calendar_year .= '<option value="0"' . $select . '> ---- </option>';

      $start_year = ( (intval($year) > 1971 ) && (intval($year) <= date('Y', time())) ) ? intval($year)-1 : date('Y', time())-1;
      for ($i = $start_year; $i <= date('Y', time())+10; $i++)
      {
         $selected = ( intval($year) == $i) ? ' selected="selected"' : '';
         $s_topic_calendar_year .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>';
      }
      $s_topic_calendar_year .= '</select>';


Does anyone know what might be wrong with this code? By the way, it does work, but it also returns a syntax error...


Thank you very much for your time and support!


**************************
EDIT

Got it!

Had to replace:
Code:
<a href="javascript:void()"

with:
Code:
<a href="javascript:void(0)"


Hope this helps someone else!
Back to top
View user's profile Send private message

Patrick
Admin/Webmaster

Joined: 11 May 2001
Posts: 17279
Location: Harbinger, NC, U.S.A.

PostPosted: August 17th 2010, 12:19 pm    Post subject: Reply with quote

Glad that you found the solution for your issue, sbourdon. Thanks for sharing.

Patrick
_________________
Patrick O'Keefe - phpBBHacks.com Administrator - Feedback? Questions? Please Contact Me!
User Guidelines - Featured phpBB - Featured Author - phpBBHacks.com Awards - Supported Sites - About Us
Author, Managing Online Forums - A Practical Guide to Community Management
phpBB 3 Tutorials: Add Hacks | Clear Your Cache | Fix Missing Images | phpBB 3 Permissions Guide
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 2 Hack Support All times are GMT - 6 Hours
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Links: Big Message Boards - Free JavaScript - phpBB2 - phpbb styles - Suporte phpBB - phpBB Česky - phpBB Turkiye - phpBBArabia.com - phpBB-fr.com - Romanian phpBB online community - phpBB-TW.net - phpBBservice.nl - phpBB Brasil - phpBB Portugal - phpBBpersian.com

Network: iFroggy Hosting - PhotoshopForums.com - Managing Online Forums - ManagingCommunities.com - CommunityAdmins.com - KarateForums.com - Bad Boy Blog - SodaRatings.com - Patrick O'Keefe

< Advertising - Contact Us - Disclosure Policy - Staff - User Guidelines >

Copyright © 2001-2012. iFroggy Network, phpBBHacks.com. All Rights Reserved. Privacy Policy. We Support phpBBHacks.com (of course!).
Powered by phpBB © phpBB Group. phpBB SEO. We are in no way affiliated with the phpBB Group. phpBB is copyright to the phpBB Group.