Return-Path: X-Original-To: apmail-tapestry-commits-archive@minotaur.apache.org Delivered-To: apmail-tapestry-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0D96518DA7 for ; Mon, 1 Jun 2015 17:57:18 +0000 (UTC) Received: (qmail 16944 invoked by uid 500); 1 Jun 2015 17:57:17 -0000 Delivered-To: apmail-tapestry-commits-archive@tapestry.apache.org Received: (qmail 16908 invoked by uid 500); 1 Jun 2015 17:57:17 -0000 Mailing-List: contact commits-help@tapestry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tapestry.apache.org Delivered-To: mailing list commits@tapestry.apache.org Received: (qmail 16898 invoked by uid 99); 1 Jun 2015 17:57:17 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2015 17:57:17 +0000 Date: Mon, 1 Jun 2015 17:57:17 +0000 (UTC) From: "Howard M. Lewis Ship (JIRA)" To: commits@tapestry.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (TAP5-2480) FormFragment can't be used in conjunction with HTML5 support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/TAP5-2480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship closed TAP5-2480. -------------------------------------- Resolution: Fixed Fix Version/s: 5.4 > FormFragment can't be used in conjunction with HTML5 support > ------------------------------------------------------------ > > Key: TAP5-2480 > URL: https://issues.apache.org/jira/browse/TAP5-2480 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-core > Affects Versions: 5.4 > Reporter: I D > Assignee: Howard M. Lewis Ship > Fix For: 5.4 > > > Steps to reproduce: > # Use Chrome > # Set SymbolConstants.ENABLE_HTML5_SUPPORT to true > # Have a page with a form containing a FormFragment containing a field with the "required" validator > # Hide the FormFragment > # Attempt to submit the form > # Note that nothing happens and the following JS error appears in the Chrome dev tools console: "An invalid form control with name='whatever' is not focusable." > This is due to the fact that when SymbolConstants.ENABLE_HTML5_SUPPORT is set to true, the "required" validator adds a "required" attribute to the form field, which in turn makes the browser want to validate it. > At first I thought this could be fixed simply by a slight modification: whenever a form fragment handles the prepareForSubmit event and sets the fragment's hidden element's "disabled" attribute, it should also set the "disabled" attributes of all inputs, selects, textareas etc contained therein to the same value. This will disable native browser validation for these fields. > However, I then realized that the prepareForSubmit event isn't even triggered by the browser in this case. > This means that we shouldn't even rely on the prepareForSubmit event here, and instead set the disabled attribute (in the generated hidden field as well as the actual ones) whenever the "events.formfragment.changeVisibility" is triggered. -- This message was sent by Atlassian JIRA (v6.3.4#6332)