commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 32476] New: - JS Validation fails on CSS hidden elements.
Date Wed, 01 Dec 2004 19:09:49 GMT
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=32476>.
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=32476

           Summary: JS Validation fails on CSS hidden elements.
           Product: Commons
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Validator
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: paul_benedict@merck.com


PROBLEM:
I am working on a web-app that has "flip-book" navigation, where multiple
fieldsets within a large form are shown/hidden determined by the tab selected.
JavaScript manages the navigation.

When our form is submitted, the client-side JavaScript bombs when it tries to
set focus to the first invalid field (missing required, not an integer, etc.)
which is also CSS hidden. JavaScript cannot set focus on a field that is hidden.
Internet Explorer generates this message: "Cannot move focus to the control
because it is invisible, not enabled, or of a type that does not accept the focus."

This is the offending code in all the validateXXX JS methods:

        if (fields.length > 0) {
           focusField.focus();
           alert(fields.join('\n'));
        }

POSSIBLE RESOLUTION:
Only set focus if "focusField.style.visibility" is not "hidden" -- since CSS can
be used to hide elements.

I tested using Commons Validator 1.1.3 with Struts 1.2.4

-- 
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.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message