最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Voice over is not reading what I am typing in textbox - Stack Overflow

programmeradmin2浏览0评论

Below is my code:

    <form>
        <div class="form-group loginFormGrp">
            <label class="caption">Backup Cloud</label>
            <div class="custSelect loginSelect">
            <label class="caption">Server URL</label>
                <input type="text" aria-label="Server URL" name="serverUrl" class="form-control" placeholder="example.server" value="">
            </div>
            <div class="form-group loginFormGrp">
                <label class="caption">Email</label>
                <input type="text" aria-label="Email" name="email" class="form-control" placeholder="[email protected]" value="">
            </div>
            <div class="loginBtnRow">
                <button tabindex="0" type="submit" class="lgBtn btn btn-primary btn-block">Continue</button>
            </div>
        </div>
    </form>

whenever voiceover highlights the input text field it reads "You are currently on text field, inside web content. To enter text in this filed, type. To exit web area,.." and when I Start typing it says nothing. and checked other appilcation or websites it reads what i am typing. but in my case its not reading. Please help if anyone knows the solution.

Below is my code:

    <form>
        <div class="form-group loginFormGrp">
            <label class="caption">Backup Cloud</label>
            <div class="custSelect loginSelect">
            <label class="caption">Server URL</label>
                <input type="text" aria-label="Server URL" name="serverUrl" class="form-control" placeholder="example.server." value="">
            </div>
            <div class="form-group loginFormGrp">
                <label class="caption">Email</label>
                <input type="text" aria-label="Email" name="email" class="form-control" placeholder="[email protected]" value="">
            </div>
            <div class="loginBtnRow">
                <button tabindex="0" type="submit" class="lgBtn btn btn-primary btn-block">Continue</button>
            </div>
        </div>
    </form>

whenever voiceover highlights the input text field it reads "You are currently on text field, inside web content. To enter text in this filed, type. To exit web area,.." and when I Start typing it says nothing. and checked other appilcation or websites it reads what i am typing. but in my case its not reading. Please help if anyone knows the solution.

Share Improve this question edited Jun 3, 2018 at 11:54 Mostafa Norzade 1,7765 gold badges27 silver badges41 bronze badges asked May 21, 2018 at 9:14 pareshmpareshm 4,9845 gold badges36 silver badges54 bronze badges 2
  • What browsers are you using? Also does the HTML change when rendered? Is there any validations happening on fields (like jQuery Validation)? Using plain html you provider it works in latest Safari and Chrome. Firefox does not, but it seems to be a Firefox issue. – thekodester Commented Jun 2, 2018 at 17:38
  • As you mentioned it is an electron APP can i know the operating system you getting this issue. – karthik Commented Jun 3, 2018 at 1:55
Add a ment  | 

3 Answers 3

Reset to default 3

Add title attribute to the input element and provide additional text.

Adding aria-label to the input elements should also be picked by the screen readers.

http://pauljadam./demos/title-aria-label.html provides details on how different browsers and screen readers treat these attributes.

Your code seems pretty fine. I tried with a chrome plugin called ChromeVox everything seems to be fine except that add the lang attribute to the parent html tag and enclose everything in a body tag some thing like this.

<html lang="en-US" style="height: 100%;">
<body>
 <form>
        <div class="form-group loginFormGrp">
            <label class="caption">Backup Cloud</label>
            <div class="custSelect loginSelect">
            <label class="caption">Server URL</label>
                <input type="text" aria-label="Server URL" name="serverUrl" class="form-control" placeholder="example.server." value="">
            </div>
            <div class="form-group loginFormGrp">
                <label class="caption">Email</label>
                <input type="text" aria-label="Email" name="email" class="form-control" placeholder="[email protected]" value="">
            </div>
            <div class="loginBtnRow">
                <button tabindex="0" type="submit" class="lgBtn btn btn-primary btn-block">Continue</button>
            </div>
        </div>
    </form>
</body>
</html>

I'm not sure if this'll help, but You may try to update fields value attribute, every time user modify text field. Something like that:

document.querySelectorAll('input[type="text"]').forEach(function(v){
    v.addEventListener('input', function(){
        v.setAttribute('value', v.value);
    });
});

But I wish someone provide better answer, without using extra JavaScript.

发布评论

评论列表(0)

  1. 暂无评论