file1.html
<html> <head> <title>AIDS (Automated ID System)</title> <HTA:APPLICATION id="frames" border="thin" caption="yes" icon="http://www.google.com/favicon.ico" showintaskbar="yes" singleinstance="yes" sysmenu="yes" navigable="yes" contextmenu="no" innerborder="no" scroll="auto" scrollflat="yes" selection="yes" windowstate="normal" /> <script language="javascript" type="text/javascript"> function pausecomp(millis) { var date = new Date(); var curDate = null; do { curDate = new Date(); } while(curDate-date < millis); } function getWindowsUserName() { var WinNetwork = new ActiveXObject("WScript.Network"); var urlToSite = createCustomURL(WinNetwork.UserName); var frame = document.getElementById("psyncLink"); frame.onload = function() { frame.onload = null; if (requestingPassword()) { </script> </head> <frameset cols="300px, *"> <frame src="leftframe.html" name="topo" id="topo" application="yes" /> <frame src="topo1.htm" name="psyncLink" id="psyncLink" application="yes" /> </frameset> </html>
leftframe.html
<html> <head> <title>AIDS Assistant</title> </head> <script language="javascript"> function checkPassword() { var validString = /^[az](?=[az]*[0-9])[a-z0-9]{0,6}[az]$/; if (validString.test(document.getElementById("newPassword").value)) { alert("The password is valid"); var validate = function () { </script> <body> <table width="300px"> <tr> <td>Type Your Old Password</td> <td><input id="oldPassword" type="text" maxlength="8" /></td> </tr> <tr> <td>Please type your new password</td> <td><input id="newPassword" type="text" maxlength="8" min="8" /></td> </tr> <tr> <td colspan="2"><input id="checkOldPassword" type="button" title="Check New Password" value="Check New Password" onclick="checkPassword()" /></td> </tr> </table> </body> </html>
Let me clarify what I'm doing.
- leftframe.html need to check text box
- After processing the left frame. It must notify the parent window file1.html so that it can load the second frame (topo1.htm)
topo.htm does not exist, so the HTA app load cannot be found for this particular frame, but it must change when we call the getWindowsUserName () function from loadOtherFrame. LoadOtherFrame is called from the leftframe.html file, as shown.
When I start the HTA, loadOtherFrame is called (before clicking the button on leftframe.html)
source share