in reply to Re: Re:* Mechanizing Javascript form
in thread Mechanizing Javascript form

The JS does appear to be essentially validation. At the risk of drifting away from Perl, I'll include the JS section and the form def. I appreciate the help.

The JavaScript...

<script language="JavaScript" type="text/JavaScript"> <!-- var smtry=0; function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseI +nt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize= +MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH +) location.reload(); } MM_reloadPage(true); function resetCredFields() { document.Login.PASSWORD.value = ""; } function submitForm() { // Strip target without params targetWithParams = document.Login.target.value; queryStrIdx = targetWithParams.indexOf("?"); if ( queryStrIdx > 0 ) { // there is query string if( targetWithParams.indexOf("SMLOCALE") <= 0 ) // SMLOCALE hs + been defined document.Login.target.value = targetWithParams ; } else { document.Login.target.value = document.Login.target.value ; alert("Final Target is " + document.Login.target.value ); } // document.Login.submit(); } function isempid (c) { submitForm(); if((c >= "100000") && (c <= "999999")){ alert("You have to Enter your Network UserID and password t +o login"); return false; } return true; } //--> </script> <script language="JavaScript1.2" type="text/javascript"> function windowHeight() { if(document.all){ //IE availW = document.body.clientHeight; } else{ //Netscape availW = window.innerHeight; } return availW; } </script>
...and the form...
<form NAME="Login" METHOD="POST" onSubmit="javascript:return i +sempid(this.USER.value);"> <INPUT TYPE=HIDDEN NAME="SMENC" VALUE="ISO-8859-1"> <INPUT type=HIDDEN name="SMLOCALE" value="US-EN"> <tr> <td align="center"> <table width="400" border="0" cellspacing="0" ce +llpadding="1"> <tr> <td align="center">&nbsp;</td> </tr> <tr> <td bgcolor="#000000"><table width="100%" bo +rder="0" cellspacing="0" cellpadding="0"> <tr bgcolor="#FFFFFF"> <td colspan="2"><table width="100%" bo +rder="0" cellspacing="0" cellpadding="3"> <tr align="center" bgcolor="#CCCCC +C"> <td colspan="2"> <script language="JavaScript" type="text/JavaScrip +t"> if (smtry) document.write ('<B><font color=red>Invalid Us +erid or Password.<br></font></b>'); </script> <b>Please enter your Network Username and Password</b></td> </tr> <tr bgcolor="#CCCCCC"> <td align="right"><b>Username</b +></td> <td align="center"> <input name= +"USER" type="text" id="USER" size="30" maxlength="80"> </td> </tr> <tr bgcolor="#CCCCCC"> <td colspan="2"><img src="images +/spacer.gif" width="1" height="1"></td> </tr> <tr bgcolor="#CCCCCC"> <td align="right"><strong>Passwo +rd</strong></td> <td align="center"><input name=" +password" type="password" id="password" size="30" maxlength="80"></td +> </tr> <tr bgcolor="#CCCCCC"> <td height="10" colspan="2"><img + src="images/spacer.gif" width="1" height="1"></td> </tr> <tr valign="middle" bgcolor="#CCCC +CC"> <input type=hidden name=target value="http://my.un +ocal.com/pls/portal30_sso/portal30_sso.wwsso_app_admin.ls_login?site2 +pstoretoken=v1.1~1363~5F3F82C6798011021FC6FD5452764DC556F2283462F74ED +DA8157273011910A6F35FCE49D515765277DEFF3C14C90177B648B52D8F9739C33FE1 +5B1437ECF6351966AEB84D56B4FFCD0F1D7BC0265D3F7385A881AE52CE9700EE4F31E +D216152DC9142A3C9018529A11AE3E1913AE47D4A18C4EF638FB059B3C1480FFAD397 +CCFAA2C36B17AD50809F904033D583E7B137B80CA6102C2F224235805C6756859E26E +BF2A84888FCF95F7EBFAA0402E37E161A4A4A2F7CFC52E9F9FC58B0CEB389896221EF +3EF144558792E96083B3714B48590A7F1B0C12AD7669AAD49223BE90B97B61C3BC933 +7F341C9288960C5E4FB9FE8D3AD5D929E84"> <input type=hidden name=smauthreason value="0 +"> <input type=hidden name=smtryno value=""> <td height="45" colspan="2" alig +n="center"><input type="submit" name="Submit" value="Login"></td> </tr> </table></td> </tr> </table></td> </tr> </table> </td> </tr> </form>