屏幕阅读器 - jQuery弹出窗口

5
我有一个弹出窗口,用户必须单击才能填写并提交表单。我不想离开页面,因此我使用了弹出窗口(对此也可以提出建议)。
这里遇到的问题是JAWS(屏幕阅读器)无法识别弹出窗口何时打开。我尝试将焦点设置为弹出窗口内的一个输入字段,但它只读取该输入字段,然后继续读取原始页面。忽略标题和除聚焦输入以外的任何其他内容。有人有什么想法吗?也许我怎样才能提醒屏幕阅读器弹出窗口已经打开,并强制屏幕阅读器读取弹出窗口并停止?
这是按钮,单击它会显示弹出窗口:
<button type="submit" name="btnCreatee" id="btnCreate" value="#createIndexDialog">Create Index</button>

这是弹出窗口的HTML内容:
    <div id="createIndexDialog" class="window" style="background-color:#ffffff;">
<div align="right"><a href="#" class="closeIndexCreation" id="closeIndexCreation"></a></div>
    <h2 style="text-align:center;color:#333;">Create an Index</h2>
    <br />
    <ul class="statusMessages" style="background: transparent;"></ul>
    <form name="createIndexFrm" id="createIndexFrm" method="post" action="createIndex.do">
        <input type="hidden" name="operation" value="create">
        <div id="t" border="0">
            <div style="display:block;margin:0 0 15px 54px;">
                <span ><b>Name:</b><input type="text" class="requiredField" maxlength="16" name="name" id="name" size="40" onblur="checkform()" style="margin-left:8px;"></span>
            </div>
            <div style="display:block;margin:0 0 15px 104px;">
                <span>
                    <ul style="list-style:none;background:#fff;border:2px solid #ebebeb;padding:5px;border-radius:5px;width:auto;">
                        <li>Index name can not be changed later.</li>
                        <li>It is not case sensitive.</li>
                        <li>Specify from 1 to 30 characters using letters (A-Z, a-z) or numbers (0-9)</li>
                    </ul>
                </span>
            </div>
            <div style="display:block;margin:0 0 15px 54px;">
                <span ><b>Type:</b><input type="radio" name="data_source_type" value="0" checked style="margin-left:5px;"> Database, <i>Select data via database connection</i></span>
            </div>
            <div style="display:block;margin:0 0 15px 0px;">
                <span ><b>Display Name:</b><input type="text" maxlength="30" name="displayName" id="displayName" size="40" value="" style="margin-left:8px;"></span>
            </div>
            <div style="display:block;margin:0 0 15px 15px;">
                <span ><b>Description:</b><textarea name="desc" id="desc" cols="75" rows="3" wrap="virtual" style="margin-left:5px;"></textarea></span>
            </div>
            <div style="display:block;margin-left:240px;">  
                <span><button type="submit" class="general ui-corner-all" name="submitCreate" id="submitCreate" onclick="createIndexFrm.operation.value='create'; document.createIndexFrm.submit(); return false;">Create</button></span>
            </div>
        </div>
    </form></div>

这是创建和显示弹出框的代码:

$('button[name=btnCreatee]').click(function(e) {
            e.preventDefault();
            var id = $(this).attr('value');
            var maskHeight = $(document).height();
            var maskWidth = $(window).width();
            $('#mask').css({'width':maskWidth,'height':maskHeight});
            $('#mask').fadeIn(200);
            $('#mask').fadeTo("fast",0.8);
            var winH = $(window).height();
            var winW = $(window).width();               
            //$(id).css('top',  winH/2-$(id).height()/2);
            //$(id).css('left', winW/2-$(id).width()/2);
            //$(id).fadeIn(400);
            $('#createIndexDialog').css('left', winW/2-$('#createIndexDialog').width()/2);              
            $('#createIndexDialog').show();

        });

附言:我正在编辑现有代码,以使页面符合508标准/易于访问。

3个回答

2
<div id="createIndexDialog" 中添加 role="alertdialog",这将有助于屏幕阅读器识别弹出窗口。

0
为什么要创建一个新窗口?这会有帮助:
window.open('windowname');

0

JQuery弹出框在508合规方面非常棘手。但是有一些事情可以帮助JAWS更好地阅读它。

  • 添加
  • 将表单控件分组在
    标签内
  • 您是否可以将表单放置在此页面的内联部分中?这样,您可以将该部分隐藏,直到需要时才扩展页面以向用户显示它。

告诉我更多关于它! - Let A Pro Do IT

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接