Skip to content
Browse files

Dialog: Visual test page for modal form dialogs

  • Loading branch information
jzaefferer committed Oct 26, 2012
1 parent 8251440 commit 039ee746d3eaeeaa4ad92ecd8ebf4e6fcd11768c
Showing with 70 additions and 0 deletions.
  1. +70 −0 tests/visual/dialog/form.html
@@ -0,0 +1,70 @@
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Dialog Visual Test</title>
<link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css">
<script src="../../../jquery-1.8.2.js"></script>
<script src="../../../external/jquery.bgiframe-2.1.2.js"></script>
<script src="../../../ui/jquery.ui.core.js"></script>
<script src="../../../ui/jquery.ui.widget.js"></script>
<script src="../../../ui/jquery.ui.mouse.js"></script>
<script src="../../../ui/jquery.ui.draggable.js"></script>
<script src="../../../ui/jquery.ui.position.js"></script>
<script src="../../../ui/jquery.ui.resizable.js"></script>
<script src="../../../ui/jquery.ui.dialog.js"></script>
<script src="../../../ui/jquery.ui.effect.js"></script>
<script src="../../../ui/jquery.ui.effect-blind.js"></script>
<script src="../../../ui/jquery.ui.effect-explode.js"></script>
$(function() {
$( "#form-dialog, #prompt-dialog" ).dialog({
autoOpen: false,
modal: true

$( "#open-form" ).click(function() {
$( "#form-dialog" ).dialog( "open" );

$( "#open-prompt" ).click(function() {
$( "#prompt-dialog" ).dialog( "open" );
label {
display: block;

<p>WHAT: A modal dialog containing form fields, with groups to describe each section. A second modal dialog with just an input and some text markup.</p>
<p>EXPECTED: Dialog shows up, screenreader reads the dialog's title, the word "dialog" (or equivalent), the text before the first input (description of the first section) and the label of the first, focused input. When tabbing to the next group, the screenreader should announce the description of that group, along with the label of the focused field.</p>
<p>For the second dialog, the behaviour should be similar, except that the whole content is read as the description of the dialog, likely causing the input's label to be read twice.</p>
<p>NOTE: Using <code>fieldset</code> with <code>legend</code> seems to have the same result as using <code>role="group"</code> and <code>aria-describedby</code>. The latter needs an id-attribute, offers more flexibilty in markup order and has no built-in styling.</p>

<div id="form-dialog" title="Profile Information">
<legend>Please share some personal information</legend>
<label for="favorite-animal">Your favorite animal</label><input id="favorite-animal">
<label for="favorite-color">Your favorite color</label><input id="favorite-color">
<div role="group" aria-describedby="section2">
<p id="section2">Some more (optional) information</p>
<label for="favorite-food">Favorite food</label><input id="favorite-food">

<button id="open-form">Open Form Dialog</button>

<div id="prompt-dialog" title="Are you sure?">
<p>Please enter password to continue.</p>
<label for="password">Password</label><input id="password">

<button id="open-prompt">Open Prompt Dialog</button>


0 comments on commit 039ee74

Please sign in to comment.
You can’t perform that action at this time.