Item12007: Extensions.JSCalendarContrib: date form field tends to override default form button

Priority: Enhancement
Current State: Closed
Released In: 1.1.6
Target Release: patch
Applies To: Extension
Component: JSCalendarContrib
Branches: Release01x01 trunk
Reported By: JanKrueger
Waiting For:
Last Change By: GeorgeClark
date form fields (and also calendar popups generated using renderDateForEdit) use CGI::image_button to generate a button that opens the calendar popup. Unfortunately, that makes the button a form button and, in some cases, this button will steal the default action from the submit button.

In our case, we've got a date field in a data form and a submit button from a custom skin further down. If we press the enter key in any text field in the form, instead of submitting it, the calendar pops up. This has been quite confusing for our users.

I've hotfixed the issue by using CGI::img instead (removing the now irrelevant -name attribute). Not sure whether this creates other issues, but seems okay for now.

-- JanKrueger - 20 Jul 2012

Using an img is the right thing to do. Here's some code to compare both:

using an input-type-image tag:

using an img tag:

-- MichaelDaum - 23 Jul 2012
Topic revision: r8 - 02 Dec 2012, 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