home *** CD-ROM | disk | FTP | other *** search
/ Your Business Pak / BusinessPak2.iso / Netscape / CD / as.z / asw.jar / email.js < prev    next >
Text File  |  1998-10-15  |  4KB  |  94 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(msg)
  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].emailPassword.value != document.forms[0].emailPasswordCheck.value)    {
  35.         if (document.forms[0].emailPassword.value == "")    {
  36.             parent.parent.globals.setFocus(document.forms[0].emailPassword);
  37.             }
  38.         else    {
  39.             parent.parent.globals.setFocus(document.forms[0].emailPasswordCheck);
  40.             }
  41.         alert("The password you entered in 'Type Password Again' does not match the password you entered in 'Password'. Please re-enter your password.");
  42.         return(false);
  43.         }
  44.     return(true);
  45. }
  46.  
  47.  
  48.  
  49. function loadData()
  50. {
  51.     // make sure all data objects/element exists and valid; otherwise, reload.  SUCKS!
  52.     if (((document.forms[0].emailName == "undefined") || (document.forms[0].emailName == "[object InputArray]")) ||
  53.         ((document.forms[0].emailPassword == "undefined") || (document.forms[0].emailPassword == "[object InputArray]")) ||
  54.         ((document.forms[0].emailPasswordCheck == "undefined") || (document.forms[0].emailPasswordCheck == "[object InputArray]")))
  55.     {
  56.         parent.controls.reloadDocument();
  57.         return;
  58.     }
  59.  
  60.     document.forms[0].emailName.value = parent.parent.globals.document.vars.emailName.value;
  61.     document.forms[0].emailPassword.value = parent.parent.globals.document.vars.emailPassword.value;
  62.     document.forms[0].emailPasswordCheck.value = parent.parent.globals.document.vars.emailPasswordCheck.value;
  63.     if (document.forms[0].emailName.value == "" && document.forms[0].emailPassword.value == "" && document.forms[0].emailPasswordCheck.value == "")    {
  64.         document.forms[0].emailName.value = parent.parent.globals.document.vars.accountName.value;
  65.         document.forms[0].emailPassword.value = parent.parent.globals.document.vars.accountPassword.value;
  66.         document.forms[0].emailPasswordCheck.value = parent.parent.globals.document.vars.accountPasswordCheck.value;
  67.         }
  68.     parent.parent.globals.setFocus(document.forms[0].emailName);
  69.     if (parent.controls.generateControls)    parent.controls.generateControls();
  70. }
  71.  
  72.  
  73.  
  74. function saveData()
  75. {
  76.     // make sure all form element are valid objects, otherwise just skip & return!
  77.     if (((document.forms[0].emailName == "undefined") || (document.forms[0].emailName == "[object InputArray]")) ||
  78.         ((document.forms[0].emailPassword == "undefined") || (document.forms[0].emailPassword == "[object InputArray]")) ||
  79.         ((document.forms[0].emailPasswordCheck == "undefined") || (document.forms[0].emailPasswordCheck == "[object InputArray]")))
  80.     {
  81.         parent.controls.reloadDocument();
  82.         return(true);
  83.     }
  84.  
  85.     parent.parent.globals.document.vars.emailName.value = document.forms[0].emailName.value;
  86.     parent.parent.globals.document.vars.emailPassword.value = document.forms[0].emailPassword.value;
  87.     parent.parent.globals.document.vars.emailPasswordCheck.value = document.forms[0].emailPasswordCheck.value;
  88.     return(true);
  89. }
  90.  
  91.  
  92.  
  93. // end hiding contents from old browsers  -->
  94.