Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon4.gif   Checks on datetime seconds field generate warning in IE7, posted by Richard Stamper on Wed Jul 1 17:00:30 2009 Javascript_warning.jpg
    icon2.gif   Re: Checks on datetime seconds field generate warning in IE7, posted by Stefan Ritt on Thu Jul 2 08:36:57 2009 
Message ID: 66428     Entry time: Wed Jul 1 17:00:30 2009     Reply to this: 66429
Icon: Warning  Author: Richard Stamper  Author Email: r.stamper@rl.ac.uk 
Category: Bug report  OS: Windows  ELOG Version: 2.7.6-2227 
Subject: Checks on datetime seconds field generate warning in IE7 

When adding a log entry containing a datetime field using the IE7 browser a Javascript warning is displayed - see the attachment.  This is due to a change in the naming of the "seconds" field of a datetime entry (made in version 2143) not being propagated to the code that generates the Javascript that checks the supplied values.

Suggested patch follows.

Change "s%d" to "c%d" in lines 9675 and 9678.

Showing lines 9675-9680 below, change from:

               rsprintf("  if (document.form1.s%d.value == \"\") {\n", i);
               sprintf(str, loc("Please enter second for attribute '%s'"), attr_list[i]);
               rsprintf("    alert(\"%s\");\n", str);
               rsprintf("    document.form1.s%d.focus();\n", i);
               rsprintf("    return false;\n");
               rsprintf("  }\n");

to:

               rsprintf("  if (document.form1.c%d.value == \"\") {\n", i);
               sprintf(str, loc("Please enter second for attribute '%s'"), attr_list[i]);
               rsprintf("    alert(\"%s\");\n", str);
               rsprintf("    document.form1.c%d.focus();\n", i);
               rsprintf("    return false;\n");
               rsprintf("  }\n");

Regards,

Richard Stamper

Attachment 1: Javascript_warning.jpg  11 kB  | Hide | Hide all
Javascript_warning.jpg
ELOG V3.1.5-fe60aaf