[appfuse-issues] [JIRA] Resolved: (APF-383) AddFocusHandlers affects readonly text fields

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[appfuse-issues] [JIRA] Resolved: (APF-383) AddFocusHandlers affects readonly text fields

AppFuse - Issues mailing list
     [ http://issues.appfuse.org/browse/APF-383?page=all ]
     
Matt Raible resolved APF-383:
-----------------------------

    Resolution: Fixed

Fixed in CVS: https://appfuse.dev.java.net/source/browse/appfuse/web/scripts/global.js?r1=1.16.2.1&r2=1.16.2.2

Thanks for the patch!

Matt

> AddFocusHandlers affects readonly text fields
> ---------------------------------------------
>
>          Key: APF-383
>          URL: http://issues.appfuse.org/browse/APF-383
>      Project: AppFuse
>         Type: Bug

>   Components: Web - General
>     Versions: 1.9.2
>     Reporter: Pascal Huoth
>     Assignee: Matt Raible
>     Priority: Trivial
>      Fix For: 1.9.3

>
> When a user focuses on a text element that is set to 'readonly', the properties of that element changes.
> // before code
> function addFocusHandlers(elements) {
>     for (i=0; i < elements.length; i++) {
>         if (elements[i].type != "button" && elements[i].type != "submit" &&
>             elements[i].type != "reset" && elements[i].type != "checkbox" && elements[i].type != "radio") {
>             if (elements[i].getAttribute('readonly') != "readonly" && elements[i].getAttribute('readonly') != "disabled") {
>                 elements[i].onfocus=function() {this.style.backgroundColor='#ffd';this.select()};
>                 elements[i].onmouseover=function() {this.style.backgroundColor='#ffd'};
>                 elements[i].onblur=function() {this.style.backgroundColor='';}
>                 elements[i].onmouseout=function() {this.style.backgroundColor='';}
>             }
>         }
>     }
> }
> // fixed code
> function addFocusHandlers(elements) {
>     for (i=0; i < elements.length; i++) {
>         if (elements[i].tagName == "TEXTAREA" || elements[i].type == "text") {
>             if (!elements[i].getAttribute('readonly')) {
>                 elements[i].onfocus=function() {this.style.backgroundColor='#ffd';this.select()};
>                 elements[i].onmouseover=function() {this.style.backgroundColor='#ffd'};
>                 elements[i].onblur=function() {this.style.backgroundColor='';}
>                 elements[i].onmouseout=function() {this.style.backgroundColor='';}
>             }
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.appfuse.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]