UNPKG

apex4x

Version:

The Comprehensive ARIA Development Suite

51 lines (50 loc) 1.8 kB
<html> <body> <!-- Important When Implementing a Close link or button, the className must match the "closeClassName" property within the script declaration. Doing so will automatically bind the close methods with this element, and set keyboard focus properly when the DC object is closed. --> <div id="dialog-login"> <form id="lbForm"> <p> <label for="uname">Username:</label> <input type="text" id="uname" name="uname" /> </p> <p> <label for="pass">Password:</label> <input type="password" id="pass" name="pass" /> </p> <p class="buttons-bar"> <input type="submit" id="lbSubmit" value="OK" /> <input type="reset" class="lbClose CloseDC" id="lbCancel" value="Cancel" /> </p> </form> <script> (function () { // The DC object is automatically declared when an embedded script is included within an external content resource to be imported. // DC provides access to the originating DC object instance. // E.G. DC.container is the container element where this content is rendered within. var frm = $A.get("lbForm"); $A(frm).on("submit", function (ev) { if (!frm.uname.value) { alert("Woops! You forgot your username..."); frm.uname.focus(); } else if (!frm.pass.value) { alert("Woops! You forgot your password..."); frm.pass.focus(); } else { alert("WOW!"); DC.remove(); } ev.preventDefault(); }); })(); </script> </div> </body> </html>