You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Thiago Henrique De Paula Figueiredo (Jira)" <ji...@apache.org> on 2021/04/05 20:44:00 UTC

[jira] [Resolved] (TAP5-2669) Tapestry Form.js running on non Tapestry forms

     [ https://issues.apache.org/jira/browse/TAP5-2669?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thiago Henrique De Paula Figueiredo resolved TAP5-2669.
-------------------------------------------------------
    Fix Version/s: 5.6.4
                   5.7.2
       Resolution: Fixed

Issue fixed by making Form generate the <form> element with data-attribute="tapestry/core/form" and having the Tapestry's form-handling JS only apply to form with that attribute.

> Tapestry Form.js running on non Tapestry forms
> ----------------------------------------------
>
>                 Key: TAP5-2669
>                 URL: https://issues.apache.org/jira/browse/TAP5-2669
>             Project: Tapestry 5
>          Issue Type: Bug
>            Reporter: Alex Craddock
>            Assignee: Thiago Henrique De Paula Figueiredo
>            Priority: Major
>             Fix For: 5.7.2, 5.6.4
>
>
> There is an issue when a non Tapestry form is being submitted, the Javascript in Form.js is triggered, specifically, 
>  
> {code:java}
> dom.onDocument("click", "input[type=submit], input[type=image]", function() { setSubmittingHidden(dom(this.element.form), this); });
> {code}
>  
> This is then causing a t:submit parameter to be added to the request query parameters via, 
>  
> {code:java}
> setSubmittingHidden
>  hidden = form.findFirst("[name='t:submit']");
>       if (!hidden) {
>         firstHidden = form.findFirst("input[type=hidden]");
>         hidden = dom.create("input", {
>           type: "hidden",
>           name: "t:submit"
>         });
>         firstHidden.insertBefore(hidden);
>       }
>       name = isCancel ? "cancel" : submitter.element.name;
>       hidden.value("[\"" + submitter.element.id + "\",\"" + name + "\"]");
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)