Foswiki on GitHub is open for business! Next release meeting: Monday September 29, 1300Z

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

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Urgent Closed Engine    
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 Foswikirev:11635 Foswikirev:11636
TargetRelease patch
ReleasedIn 1.1.4
Topic attachments
I Attachment Action Size Date Who Comment
foswiki_edit.jsjs foswiki_edit.js manage 2.4 K 05 May 2011 - 23:04 KennethLavrsen  
foswiki_edit.js.gzgz foswiki_edit.js.gz manage 0.8 K 05 May 2011 - 23:05 KennethLavrsen  
foswiki_edit.zipzip foswiki_edit.zip manage 3.9 K 05 May 2011 - 23:19 KennethLavrsen  
foswiki_edit_src.jsjs foswiki_edit_src.js manage 5.7 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 CopyrightStatement. Creative Commons License