home *** CD-ROM | disk | FTP | other *** search
/ Online Praxis 1998 March / Image.iso / CD-ROM / NETSCAPE / CCK / INSTBLDR.Z / asw.jar / namepw.js < prev    next >
Encoding:
Text File  |  1998-02-27  |  4.4 KB  |  115 lines

  1. <!--  to hide script contents from old browsers
  2.  
  3.  
  4.  
  5. function go()
  6. {
  7.     if (parent.parent.globals.document.vars.editMode.value == "yes")
  8.         return true;
  9.     else
  10.         return(checkData());
  11. }
  12.  
  13.  
  14.  
  15. function checkData()
  16. {
  17.     if (document.forms[0].accountName.value == "")    {
  18.         alert("You must enter a login name.");
  19.         parent.parent.globals.setFocus(document.forms[0].accountName);
  20.         return(false);
  21.         }
  22.     if (document.forms[0].accountPassword.value != document.forms[0].accountPasswordCheck.value)    {
  23.         if (document.forms[0].accountPassword.value == "")    {
  24.             parent.parent.globals.setFocus(document.forms[0].accountPassword);
  25.             }
  26.         else    {
  27.             parent.parent.globals.setFocus(document.forms[0].accountPasswordCheck);
  28.             }
  29.         alert("The password you entered in 'Type Password Again' does not match the password you entered in 'Password'. Please re-enter your password.");
  30.         return(false);
  31.         }
  32.     return true;
  33. }
  34.  
  35.  
  36.  
  37. function loadData()
  38. {
  39.     // make sure all data objects/element exists and valid; otherwise, reload.  SUCKS!
  40.     if (((document.forms[0].accountName == "undefined") || (document.forms[0].accountName == "[object InputArray]")) ||
  41.         ((document.forms[0].accountPassword == "undefined") || (document.forms[0].accountPassword == "[object InputArray]")) ||
  42.         ((document.forms[0].accountPasswordCheck == "undefined") || (document.forms[0].accountPasswordCheck == "[object InputArray]")))
  43.     {
  44.         parent.controls.reloadDocument();
  45.         return;
  46.     }
  47.  
  48.     document.forms[0].accountName.value = parent.parent.globals.document.vars.accountName.value;
  49.     document.forms[0].accountPassword.value = parent.parent.globals.document.vars.accountPassword.value;
  50.     document.forms[0].accountPasswordCheck.value = parent.parent.globals.document.vars.accountPasswordCheck.value;
  51.     parent.parent.globals.setFocus(document.forms[0].accountName);
  52.  
  53.     var theFile = parent.parent.globals.getAcctSetupFilename(self);
  54.     var ttyFlag = parent.parent.globals.GetNameValuePair(theFile,"Existing Acct Mode","AskTTY");
  55.     ttyFlag = ttyFlag.toLowerCase();
  56.     if (ttyFlag != "no")    {
  57.         // make sure all data objects/element exists and valid; otherwise, reload.  SUCKS!
  58.         if ((document.forms[0].ttyWindow == "undefined") || (document.forms[0].ttyWindow == "[object InputArray]"))
  59.         {
  60.             parent.controls.reloadDocument();
  61.             return;
  62.             }
  63.         document.forms[0].ttyWindow.checked = parent.parent.globals.document.vars.ttyWindow.checked;
  64.         }
  65.     if (parent.controls.generateControls)    parent.controls.generateControls();
  66. }
  67.  
  68.  
  69.  
  70. function saveData()
  71. {
  72.     // make sure all form element are valid objects, otherwise just skip & return!
  73.     if (((document.forms[0].accountName == "undefined") || (document.forms[0].accountName == "[object InputArray]")) ||
  74.         ((document.forms[0].accountPassword == "undefined") || (document.forms[0].accountPassword == "[object InputArray]")) ||
  75.         ((document.forms[0].accountPasswordCheck == "undefined") || (document.forms[0].accountPasswordCheck == "[object InputArray]")))
  76.     {
  77.         parent.controls.reloadDocument();
  78.         return;
  79.     }
  80.  
  81.     parent.parent.globals.document.vars.accountName.value = document.forms[0].accountName.value;
  82.     parent.parent.globals.document.vars.accountPassword.value = document.forms[0].accountPassword.value;
  83.     parent.parent.globals.document.vars.accountPasswordCheck.value = document.forms[0].accountPasswordCheck.value;
  84.  
  85.     var theFile = parent.parent.globals.getAcctSetupFilename(self);
  86.     var ttyFlag = parent.parent.globals.GetNameValuePair(theFile,"Existing Acct Mode","AskTTY");
  87.     ttyFlag = ttyFlag.toLowerCase();
  88.     if (ttyFlag != "no")    {
  89.         // make sure all form element are valid objects, otherwise just skip & return!
  90.         if ((document.forms[0].ttyWindow == "undefined") || (document.forms[0].ttyWindow == "[object InputArray]")) {
  91.             parent.controls.reloadDocument();
  92.             return;
  93.             }
  94.         parent.parent.globals.document.vars.ttyWindow.checked = document.forms[0].ttyWindow.checked;
  95.         }
  96.     else    {
  97.         parent.parent.globals.document.vars.ttyWindow.checked = 0;
  98.         }
  99. }
  100.  
  101.  
  102.  
  103. function generateTTYsupport()
  104. {
  105.     var theFile = parent.parent.globals.getAcctSetupFilename(self);
  106.     ttyFlag = parent.parent.globals.GetNameValuePair(theFile,"Existing Acct Mode","AskTTY");
  107.     ttyFlag = ttyFlag.toLowerCase();
  108.     if (ttyFlag != "no")    {
  109.         document.writeln("<INPUT NAME='ttyWindow' TYPE='checkbox'><P CLASS='tty'>I would like a terminal (TTY) window so that I can log in manually when I connect.</P>");
  110.         }
  111. }
  112.  
  113.  
  114. // end hiding contents from old browsers  -->
  115.