Changeset 11772

Show
Ignore:
Timestamp:
12/10/07 10:57:49 (8 months ago)
Author:
becky
Message:

refs #5117. Add the text form any label element associated with the textarea to the title of the document in the FF iframe for a11y.

Location:
dijit/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • dijit/trunk/form/Textarea.js

    r11660 r11772  
    122122                        // the cryptic name and will also convey the role information to the user. 
    123123                        // Because it is read directly to the user, the string must be localized. 
     124                        // In addition, since a <label> element can not be associated with an iframe, if  
     125                        // this control has a label, insert the label text into the title as well. 
    124126                        var _nlsResources = dojo.i18n.getLocalization("dijit", "Textarea"); 
    125127                        this._iframeEditTitle = _nlsResources.iframeEditTitle; 
    126128                        this._iframeFocusTitle = _nlsResources.iframeFocusTitle; 
     129                        var label=dojo.query('label[for="'+this.id+'"]'); 
     130                        if(label.length){ 
     131                                this._iframeEditTitle = label[0].innerHTML + " " + this._iframeEditTitle; 
     132                        } 
    127133                        var body = this.focusNode = this.editNode = document.createElement('BODY'); 
    128134                        body.style.margin="0px"; 
  • dijit/trunk/tests/form/test_Textarea.html

    r11475 r11772  
    2222 
    2323                <form id="form1" action="" name="example" method="post"> 
    24                 <textarea name="plainTextArea" rows=5> 
     24                <label for="plain">HTML textarea: </label><textarea name="plainTextArea" id="plain" rows=5> 
    2525                        this is a plain text area 
    2626                        for comparison 
    2727                </textarea> 
    28                 <br><textarea id="programmatic"></textarea> 
     28                <br><label for="programmatic">programmatically created:</label> <textarea id="programmatic"></textarea> 
    2929                <script type="text/javascript"> 
    3030                        // See if we can make a widget in script 
     
    3838                        }); 
    3939                </script> 
    40                 <br>Inline:<div name="simpleTextArea" dojoType="dijit.form.Textarea" style="width:33%;border:20px solid red;" 
     40                <br><label for="simple">Inline:</label><div name="simpleTextArea" dojoType="dijit.form.Textarea" id="simple" style="width:33%;border:20px solid red;" 
    4141                        onChange="dojo.byId('ocSimple').value=arguments[0]" 
    4242                        >this is a very simple resizable text area</div>