home *** CD-ROM | disk | FTP | other *** search
/ Online Praxis 1998 March / Image.iso / CD-ROM / NETSCAPE / CCK / INSTBLDR.Z / asw.jar / acctInfo.js < prev    next >
Encoding:
Text File  |  1998-02-27  |  3.0 KB  |  91 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].first.value == "")    {
  18.         alert("You must enter a first name.");
  19.         document.forms[0].first.focus();
  20.         document.forms[0].first.select();
  21.         return false;
  22.         }
  23.     if (document.forms[0].last.value == "")    {
  24.         alert("You must enter a last name.");
  25.         document.forms[0].last.focus();
  26.         document.forms[0].last.select();
  27.         return false;
  28.         }
  29. /*
  30.     if (document.forms[0].areaCode.value == "")    {
  31.         alert("You must enter an area code.");
  32.         document.forms[0].areaCode.focus();
  33.         document.forms[0].areaCode.select();
  34.         return false;
  35.         }
  36.     if (document.forms[0].phoneNumber.value == "")    {
  37.         alert("You must enter a telephone number.");
  38.         document.forms[0].phoneNumber.focus();
  39.         document.forms[0].phoneNumber.select();
  40.         return false;
  41.         }
  42. */
  43.     return true;
  44. }
  45.  
  46.  
  47.  
  48. function loadData()
  49. {
  50.     // make sure all data objects/element exists and valid; otherwise, reload.  SUCKS!
  51.     if (((document.forms[0].first == "undefined") || (document.forms[0].first == "[object InputArray]")) ||
  52.         ((document.forms[0].last == "undefined") || (document.forms[0].last == "[object InputArray]")) ||
  53.         ((document.forms[0].company == "undefined") || (document.forms[0].company == "[object InputArray]")))
  54.     {
  55.         parent.controls.reloadDocument();
  56.         return;
  57.     }
  58.  
  59.     document.forms[0].first.value = parent.parent.globals.document.vars.first.value;
  60.     document.forms[0].last.value = parent.parent.globals.document.vars.last.value;
  61.     document.forms[0].company.value = parent.parent.globals.document.vars.company.value;
  62. //    document.forms[0].areaCode.value = parent.parent.globals.document.vars.areaCode.value;
  63. //    document.forms[0].phoneNumber.value = parent.parent.globals.document.vars.phoneNumber.value;
  64.     parent.parent.globals.setFocus(document.forms[0].first);
  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].first == "undefined") || (document.forms[0].first == "[object InputArray]")) ||
  74.         ((document.forms[0].last == "undefined") || (document.forms[0].last == "[object InputArray]")) ||
  75.         ((document.forms[0].company == "undefined") || (document.forms[0].company == "[object InputArray]")))
  76.     {
  77.         parent.controls.reloadDocument();
  78.         return;
  79.     }
  80.  
  81.     parent.parent.globals.document.vars.first.value = document.forms[0].first.value;
  82.     parent.parent.globals.document.vars.last.value = document.forms[0].last.value;
  83.     parent.parent.globals.document.vars.company.value = document.forms[0].company.value;
  84. //    parent.parent.globals.document.vars.areaCode.value = document.forms[0].areaCode.value;
  85. //    parent.parent.globals.document.vars.phoneNumber.value = document.forms[0].phoneNumber.value;
  86. }
  87.  
  88.  
  89.  
  90. // end hiding contents from old browsers  -->
  91.