Difference between revisions of "Aria live error handling"

From Level Access Web Labs
Jump to navigation Jump to search
Line 1: Line 1:
<htm lang=en-usl>
<htm lang=en-us>

Revision as of 00:48, 10 June 2014

<htm lang=en-us> <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(); } }


</head> <body>

<label id="myLbl" for="x">Email <input type="text" id="x" aria-describedby="z"/>


This is the constraint pop-up

<label id="myLbl2" for="uname">Username <input type="text" id="uname" aria-describedby="constraint2" onblur="check();"/>


This is the constraint pop-up for username

<button id="btnSubmit" onclick="myFunction();">click me</button>

</body> </html>