home *** CD-ROM | disk | FTP | other *** search
/ Your Business Pak / BusinessPak2.iso / Netscape / CD / as.z / asw.jar / namepw.js < prev    next >
Text File  |  1998-10-15  |  5KB  |  132 lines

  1. /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. <!--  to hide script contents from old browsers
  19.  
  20.  
  21.  
  22. function go()
  23. {
  24.     if (parent.parent.globals.document.vars.editMode.value == "yes")
  25.         return true;
  26.     else
  27.         return(checkData());
  28. }
  29.  
  30.  
  31.  
  32. function checkData()
  33. {
  34.     if (document.forms[0].accountName.value == "")    {
  35.         alert("You must enter a login name.");
  36.         parent.parent.globals.setFocus(document.forms[0].accountName);
  37.         return(false);
  38.         }
  39.     if (document.forms[0].accountPassword.value != document.forms[0].accountPasswordCheck.value)    {
  40.         if (document.forms[0].accountPassword.value == "")    {
  41.             parent.parent.globals.setFocus(document.forms[0].accountPassword);
  42.             }
  43.         else    {
  44.             parent.parent.globals.setFocus(document.forms[0].accountPasswordCheck);
  45.             }
  46.         alert("The password you entered in 'Type Password Again' does not match the password you entered in 'Password'. Please re-enter your password.");
  47.         return(false);
  48.         }
  49.     return true;
  50. }
  51.  
  52.  
  53.  
  54. function loadData()
  55. {
  56.     // make sure all data objects/element exists and valid; otherwise, reload.  SUCKS!
  57.     if (((document.forms[0].accountName == "undefined") || (document.forms[0].accountName == "[object InputArray]")) ||
  58.         ((document.forms[0].accountPassword == "undefined") || (document.forms[0].accountPassword == "[object InputArray]")) ||
  59.         ((document.forms[0].accountPasswordCheck == "undefined") || (document.forms[0].accountPasswordCheck == "[object InputArray]")))
  60.     {
  61.         parent.controls.reloadDocument();
  62.         return;
  63.     }
  64.  
  65.     document.forms[0].accountName.value = parent.parent.globals.document.vars.accountName.value;
  66.     document.forms[0].accountPassword.value = parent.parent.globals.document.vars.accountPassword.value;
  67.     document.forms[0].accountPasswordCheck.value = parent.parent.globals.document.vars.accountPasswordCheck.value;
  68.     parent.parent.globals.setFocus(document.forms[0].accountName);
  69.  
  70.     var theFile = parent.parent.globals.getAcctSetupFilename(self);
  71.     var ttyFlag = parent.parent.globals.GetNameValuePair(theFile,"Existing Acct Mode","AskTTY");
  72.     ttyFlag = ttyFlag.toLowerCase();
  73.     if (ttyFlag != "no")    {
  74.         // make sure all data objects/element exists and valid; otherwise, reload.  SUCKS!
  75.         if ((document.forms[0].ttyWindow == "undefined") || (document.forms[0].ttyWindow == "[object InputArray]"))
  76.         {
  77.             parent.controls.reloadDocument();
  78.             return;
  79.             }
  80.         document.forms[0].ttyWindow.checked = parent.parent.globals.document.vars.ttyWindow.checked;
  81.         }
  82.     if (parent.controls.generateControls)    parent.controls.generateControls();
  83. }
  84.  
  85.  
  86.  
  87. function saveData()
  88. {
  89.     // make sure all form element are valid objects, otherwise just skip & return!
  90.     if (((document.forms[0].accountName == "undefined") || (document.forms[0].accountName == "[object InputArray]")) ||
  91.         ((document.forms[0].accountPassword == "undefined") || (document.forms[0].accountPassword == "[object InputArray]")) ||
  92.         ((document.forms[0].accountPasswordCheck == "undefined") || (document.forms[0].accountPasswordCheck == "[object InputArray]")))
  93.     {
  94.         parent.controls.reloadDocument();
  95.         return;
  96.     }
  97.  
  98.     parent.parent.globals.document.vars.accountName.value = document.forms[0].accountName.value;
  99.     parent.parent.globals.document.vars.accountPassword.value = document.forms[0].accountPassword.value;
  100.     parent.parent.globals.document.vars.accountPasswordCheck.value = document.forms[0].accountPasswordCheck.value;
  101.  
  102.     var theFile = parent.parent.globals.getAcctSetupFilename(self);
  103.     var ttyFlag = parent.parent.globals.GetNameValuePair(theFile,"Existing Acct Mode","AskTTY");
  104.     ttyFlag = ttyFlag.toLowerCase();
  105.     if (ttyFlag != "no")    {
  106.         // make sure all form element are valid objects, otherwise just skip & return!
  107.         if ((document.forms[0].ttyWindow == "undefined") || (document.forms[0].ttyWindow == "[object InputArray]")) {
  108.             parent.controls.reloadDocument();
  109.             return;
  110.             }
  111.         parent.parent.globals.document.vars.ttyWindow.checked = document.forms[0].ttyWindow.checked;
  112.         }
  113.     else    {
  114.         parent.parent.globals.document.vars.ttyWindow.checked = 0;
  115.         }
  116. }
  117.  
  118.  
  119.  
  120. function generateTTYsupport()
  121. {
  122.     var theFile = parent.parent.globals.getAcctSetupFilename(self);
  123.     ttyFlag = parent.parent.globals.GetNameValuePair(theFile,"Existing Acct Mode","AskTTY");
  124.     ttyFlag = ttyFlag.toLowerCase();
  125.     if (ttyFlag != "no")    {
  126.         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>");
  127.         }
  128. }
  129.  
  130.  
  131. // end hiding contents from old browsers  -->
  132.