You are here: Foswiki>Tasks Web>Item10714 (17 Dec 2011, GeorgeClark)Edit Attach

Item10714: Form fields of type date cannot be edited with pop-up calendar

pencil
Priority: Urgent
Current State: Closed
Released In: 1.1.4
Target Release: patch
Applies To: Engine
Component:
Branches:
Reported By: KennethLavrsen
Waiting For:
Last Change By: GeorgeClark
We have a very serious problem in 1.1.3

It is impossible to edit a date of a topic with a form that has date fields.

The minute you click on the date icon the topic is saved with whatever is there.

This is creating a bit of a panic here.

To reproduce do this.

  • Create a form with a field of type date
  • Create a topic and add the form
  • Save this topic.
  • Edit the topic
  • Click on the calendar icon next to the date field
  • Watch the topic being saved as if you had clicked the save button

This only happens in Internet Explorer 8. I do not see it in Firefox.

This affects nearly ALL my users. I would be very thankful for a quick fix or workaround for this one.

-- KennethLavrsen - 05 May 2011

It is because of a bug in one of jquery's selectors:

$('.foswikiEditForm').submit(function(e) {
   foswiki.Edit.validateMandatoryFields();
});

foswikiEditForm is not the form, but a div. Apparently, IE8 thinks that clicking a div means submitting the form.

This is fixed with the proper reference:
$(document.forms[name='main']).submit(function(e) {
   foswiki.Edit.validateMandatoryFields();
});

Oh yeah, this also means that up to now, the function validateMandatoryFields was never called, on no browser. That should have been noticed before...

-- ArthurClemens - 05 May 2011

Huge thank you for fixing this so fast.

-- KennethLavrsen - 05 May 2011

For those that need a fast fix for 1.1.3 I have attached the fixed js file in the compressed form to this bug report.

Replace the /pub/System/JavascriptFiles/foswiki_edit_src.js, /pub/System/JavascriptFiles/foswiki_edit.js, and /pub/System/JavascriptFiles/foswiki_edit.js.gz by these files.

Also uploaded a zip with the 3 files. It may be easier to download without getting newline conversion problems.

-- KennethLavrsen - 05 May 2011
 

ItemTemplate edit

Summary Form fields of type date cannot be edited with pop-up calendar
ReportedBy KennethLavrsen
Codebase 1.1.3, trunk
SVN Range
AppliesTo Engine
Component
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:d0a138285f08 distro:a2ddc7b2663f
TargetRelease patch
ReleasedIn 1.1.4
I Attachment Action Size Date Who Comment
foswiki_edit.jsjs foswiki_edit.js manage 2 K 05 May 2011 - 23:04 KennethLavrsen  
foswiki_edit.js.gzgz foswiki_edit.js.gz manage 868 bytes 05 May 2011 - 23:05 KennethLavrsen  
foswiki_edit.zipzip foswiki_edit.zip manage 3 K 05 May 2011 - 23:19 KennethLavrsen  
foswiki_edit_src.jsjs foswiki_edit_src.js manage 5 K 05 May 2011 - 23:20 KennethLavrsen  
Topic revision: r6 - 17 Dec 2011, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy