DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36338>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36338

           Summary: "onsubmit called twice" handling redoubles alert
           Product: Cocoon 2
           Version: 2.1.7
          Platform: Other
        OS/Version: other
            Status: NEW
          Keywords: PatchAvailable
          Severity: normal
          Priority: P2
         Component: CocoonForms
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


As reaction to a double click in a cforms form the javascript function
"forms_onsubmit()" (in "forms-lib.js") opens an alert popup. As IE seems to
handle double clicks itself Mozilla does not, so this alert can be easily
reproduced. But after this alert it happens with the next usual (single click)
form submit this alert is shown again. Which is a false behaviour.

We've done some experiments here with a simple solution: Add an ELSE path to
this JS function like this:

function forms_onsubmit() {
    if (forms_onsubmitHandlers == null) {
        alert("onsubmit called twice!");
    } else {
        for (var i = 0; i < forms_onsubmitHandlers.length; i++) {
            forms_onsubmitHandlers[i].forms_onsubmit();
        }
        // clear it
        forms_onsubmitHandlers = null;
    }
}

But we absolutely cannot see, why this makes a difference and solves the
problem. But it does.

Note: My first bugzilla. Please be gentle in case of faulty description or
duplicate.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to