Difference between revisions of "Category:Aria-live"

From Level Access Web Labs
Jump to navigation Jump to search
(Replaced content with " Category:ARIA")
Line 1: Line 1:
<html>
 
<head>
 
  
<script type="text/javascript">
 
// function to display constraints as well as error messages.
 
function myFunction(){
 
 
document.getElementById("errMsg").style.display="block";
 
document.getElementById("errMsg2").style.display="block";
 
document.getElementById("top").focus();
 
}
 
// function validating the username text field and displaying an error is the value is 't'
 
function check ()
 
{
 
var txtValue = document.getElementById("uname").value;
 
 
if (txtValue == "t"){
 
document.getElementById("errMsg2").style.display="block";
 
document.getElementById("uname").focus();}
 
else {
 
document.getElementById("btnSubmit").focus();
 
}
 
}
 
 
</script>
 
 
</head>
 
<body>
 
<div id="top" tabindex="-1">
 
<label id="myLbl" for="x">Email
 
<input type="text" id="x" aria-describedby="z"/>
 
<div id="errMsg" aria-live="polite" style="display:none">Error - Your email is not valid</div>
 
</label>
 
 
<div id="z">This is the constraint pop-up</div>
 
 
 
<label id="myLbl2" for="uname">Username
 
<input type="text" id="uname" aria-describedby="constraint2" onblur="check();"/>
 
<div id="errMsg2" aria-live="polite" style="display:none">Error - Your username is not valid</div>
 
</label>
 
 
<div id="constraint2">This is the constraint pop-up for username</div>
 
 
<button id="btnSubmit" onclick="myFunction();">click me</button>
 
</div>
 
</body>
 
</html>
 
  
 
[[Category:ARIA]]
 
[[Category:ARIA]]

Revision as of 21:18, 9 June 2014

Pages in category "Aria-live"

The following 2 pages are in this category, out of 2 total.