Results 1 to 3 of 3

Thread: Javascript error in date fields/calendar popups

  1. #1
    cmayo is offline Junior Member
    Join Date
    Nov 2007
    Posts
    2

    Default Javascript error in date fields/calendar popups

    Hello all,

    I'm working on a new client's system, and it seems that every date field on his system that's linked to a popup calendar is throwing an "Object Expected" Javascript error on exiiting the field. I've spent a few hours trying to find the problem without much luck...

    I've tried to boil the code down to a short example... does anyone see anything glaringly wrong with the code below?

    Thanks in advance for any ideas,

    Chuck


    HTML Code:
    <html style="background-color: buttonface; color: buttontext;">
    
    <head>
    <meta http-equiv="content-type" content="text/xml; charset=utf-8" />
    
    <title>Simple calendar setups [popup calendar]</title>
    
      <!-- calendar stylesheet -->
      <link rel="stylesheet" type="text/css" media="all" href="chuck_cal/jscalendar-1.0/calendar-win2k-cold-1.css" title="win2k-cold-1" />
    
      <script type="text/javascript" src="javascript/jscalendar-1.0/calendar.js"></script>
      <script type="text/javascript" src="chuck_cal/jscalendar-1.0/lang/calendar-en.js"></script>
      <script type="text/javascript" src="chuck_cal/jscalendar-1.0/calendar-setup.js"></script>
    
    </head>
    
    <body>
    
    <form action="#" method="get">
    <input type="text" name="date" id="f_date_a" onblur="parseDate(this, '{CALENDAR_DATEFORMAT}');" />
    </form>
    
    <script type="text/javascript">
        Calendar.setup({
            inputField     :    "f_date_a",   // id of the input field
            ifFormat       :    "%Y-%m-%d %H:%M",       // format of the input field
            showsTime      :    true,
            timeFormat     :    "24"
        });
    </script>
    
    </body>

  2. #2
    sacramentojoe is offline Sugar Community Member
    Join Date
    Nov 2005
    Posts
    447

    Default Re: Javascript error in date fields/calendar popups

    this is what I have:
    Calendar.setup ({

    inputField : "jscal_field", ifFormat : "{CALENDAR_DATEFORMAT}", showsTime : false, button : "jscal_trigger", singleClick : true, step : 1

    });

    the formatting is handled automatically by Sugar

  3. #3
    cmayo is offline Junior Member
    Join Date
    Nov 2007
    Posts
    2

    Default Re: Javascript error in date fields/calendar popups

    Yeah, I see what you mean - seems like the onblur=parseDate() event is trying to do the same thing the Calendar already does -- to format the value in the date field. I just can't figure out why every date field in the app was coded that way.

    If the calendar's already doing the formatting in the date field, I don't see the need for the redundant onblur action. Maybe I just need to remove the onBlur=parseDate() from all those date popups, but I can't help thinking the site was coded that way for a good reason.

    It's more likely that something's gone wonky in a configuration somewhere that broke all those date fields.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Custom Date Fields Not Saving Correctly
    By 1kether1 in forum Help
    Replies: 6
    Last Post: 2008-06-02, 11:29 AM
  2. ZuckerDocs date Parameter
    By Barakanooz in forum Help
    Replies: 2
    Last Post: 2007-01-16, 05:12 PM
  3. Help with Date Format
    By cwking in forum General Discussion
    Replies: 0
    Last Post: 2006-05-13, 10:32 PM
  4. Project Task due date requirement
    By dschaefer in forum Feature Requests
    Replies: 0
    Last Post: 2006-02-03, 07:08 PM
  5. Problem with Date format
    By nicolas in forum Help
    Replies: 1
    Last Post: 2005-05-19, 02:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •