⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form_check.js.php

📁 集成了投票调查、流量统计、文件上传、留言版、论坛、软件下载、文章赏析、通讯录、网上购物 等板块 管理账户为peilei 密码为800901
💻 PHP
字号:
<script language="javascript"><!--
function check_form() {
  var error = 0;
  var error_message = "<?php echo JS_ERROR; ?>";

<?php
// ******************************************************************
//
// ******************************************************************
   if ((ACCOUNT_FIRSTNAME == 'true') && (ACCOUNT_REQUIRED_FIRSTNAME == 'true')) echo '    var first_name = document.account_edit.firstname.value;' . "\n";
   if ((ACCOUNT_LASTNAME == 'true') && (ACCOUNT_REQUIRED_LASTNAME == 'true')) echo '    var last_name = document.account_edit.lastname.value;' . "\n";
   if ((ACCOUNT_DOB == 'true') && (ACCOUNT_REQUIRED_DOB == 'true')) echo '  var dob = document.account_edit.dob.value;' . "\n";
   if ((ACCOUNT_EMAIL == 'true') && (ACCOUNT_REQUIRED_EMAIL == 'true')) echo '  var email_address = document.account_edit.email_address.value; ' . "\n";

   if ((ACCOUNT_COMPANY == 'true') && (ACCOUNT_REQUIRED_COMPANY == 'true')) echo '  var company = document.account_edit.company.value;' . "\n";

   if ((ACCOUNT_ADDRESS == 'true') && (ACCOUNT_REQUIRED_ADDRESS == 'true')) echo '  var street_address = document.account_edit.street_address.value;' . "\n";
   if ((ACCOUNT_ZIPCODE == 'true') && (ACCOUNT_REQUIRED_ZIPCODE == 'true')) echo '  var postcode = document.account_edit.postcode.value;' . "\n";
   if ((ACCOUNT_CITY == 'true') && (ACCOUNT_REQUIRED_CITY == 'true')) echo '  var city = document.account_edit.city.value;' . "\n";

   if ((ACCOUNT_PHONE == 'true') && (ACCOUNT_REQUIRED_PHONE == 'true')) echo '  var telephone = document.account_edit.telephone.value;' . "\n";
   if ((ACCOUNT_FAX == 'true') && (ACCOUNT_REQUIRED_FAX == 'true')) echo '  var fax = document.account_edit.fax.value;' . "\n";
?>

  var password = document.account_edit.password.value;
  var confirmation = document.account_edit.confirmation.value;

<?php
// ******************************************************************
//
// ******************************************************************
   if ((ACCOUNT_GENDER == 'true') && (ACCOUNT_REQUIRED_GENDER == 'true')) {
?>
  if (document.account_edit.elements['gender'].type != "hidden") {
    if (document.account_edit.gender[0].checked || document.account_edit.gender[1].checked) {
    } else {
      error_message = error_message + "<?php echo JS_GENDER; ?>";
      error = 1;
    }
  }
<?php
   }
// ******************************************************************
//
// ******************************************************************
   if ((ACCOUNT_FIRSTNAME == 'true') && (ACCOUNT_REQUIRED_FIRSTNAME == 'true')){
?>
  if (document.account_edit.elements['firstname'].type != "hidden") {
    if (first_name == '' || first_name.length < <?php echo ENTRY_FIRST_NAME_MIN_LENGTH; ?>) {
      error_message = error_message + "<?php echo JS_FIRST_NAME; ?>";
      error = 1;
	}
  }

<?php
   }
// ******************************************************************
//
// ******************************************************************
   if ((ACCOUNT_LASTNAME == 'true') && (ACCOUNT_REQUIRED_LASTNAME == 'true')) {
?>
  if (document.account_edit.elements['lastname'].type != "hidden") {
    if (last_name == '' || last_name.length < <?php echo ENTRY_LAST_NAME_MIN_LENGTH; ?>) {
      error_message = error_message + "<?php echo JS_LAST_NAME; ?>";
      error = 1;
    }
  }

<?php
   }
// ******************************************************************
//
// ******************************************************************
   if ((ACCOUNT_DOB == 'true') && (ACCOUNT_REQUIRED_DOB == 'true')) {
?>
  if (document.account_edit.elements['dob'].type != "hidden") {
    if (dob == '' || dob.length < <?php echo ENTRY_DOB_MIN_LENGTH; ?>) {
      error_message = error_message + "<?php echo JS_DOB; ?>";
      error = 1;
    }
  }
<?php
  }
// ******************************************************************
//
// ******************************************************************
   if ((ACCOUNT_EMAIL == 'true') && (ACCOUNT_REQUIRED_EMAIL == 'true')) {
?>
  if (document.account_edit.elements['email_address'].type != "hidden") {
    if (email_address == '' || email_address.length < <?php echo ENTRY_EMAIL_ADDRESS_MIN_LENGTH; ?>) {
      error_message = error_message + "<?php echo JS_EMAIL_ADDRESS; ?>";
      error = 1;
    }
  }
<?php
   }
// ******************************************************************
//
// ******************************************************************
   if ((ACCOUNT_COMPANY == 'true') && (ACCOUNT_REQUIRED_COMPANY == 'true')) {
?>
 
  if (document.account_edit.elements['company'].type != "hidden") {
    if (company == '' || company.length < <?php echo ENTRY_COMPANY_LENGTH; ?>) {
      error_message = error_message + "<?php echo JS_COMPANY; ?>";
      error = 1;
    }
  }
<?php
   }
// ******************************************************************
//
// ******************************************************************
   if ((ACCOUNT_ADDRESS == 'true') && (ACCOUNT_REQUIRED_ADDRESS == 'true')) {
?>
  if (document.account_edit.elements['street_address'].type != "hidden") {
    if (street_address == '' || street_address.length < <?php echo ENTRY_STREET_ADDRESS_MIN_LENGTH; ?>) {
      error_message = error_message + "<?php echo JS_ADDRESS; ?>";
      error = 1;
    }
  }
<?php
   }
// ******************************************************************
//
// ******************************************************************
   if ((ACCOUNT_ZIPCODE == 'true') && (ACCOUNT_REQUIRED_ZIPCODE == 'true')) {
?>
  if (document.account_edit.elements['postcode'].type != "hidden") {
    if (postcode == '' || postcode.length < <?php echo ENTRY_POSTCODE_MIN_LENGTH; ?>) {
      error_message = error_message + "<?php echo JS_POST_CODE; ?>";
      error = 1;
    }
  }
<?php
   }
// ******************************************************************
//
// ******************************************************************
   if ((ACCOUNT_CITY == 'true') && (ACCOUNT_REQUIRED_CITY == 'true')) {
?>
  if (document.account_edit.elements['city'].type != "hidden") {
    if (city == '' || city.length < <?php echo ENTRY_CITY_MIN_LENGTH; ?>) {
      error_message = error_message + "<?php echo JS_CITY; ?>";
      error = 1;
    }
  }

<?php
  }
// ******************************************************************
//
// ******************************************************************
   if ((ACCOUNT_COUNTRY == 'true') && (ACCOUNT_REQUIRED_COUNTRY == 'true')) {
?>
  if (document.account_edit.elements['country'].type != "hidden") {
    if (document.account_edit.country.value == 0) {
      error_message = error_message + "<?php echo JS_COUNTRY; ?>";
      error = 1;
    }
  }

<?php
   }
// ******************************************************************
//
// ******************************************************************
   if ((ACCOUNT_STATE == 'true') && (ACCOUNT_REQUIRED_STATE == 'true')) {
?>
  if (document.account_edit.elements['zone_id'].type != "hidden") {
    if (document.account_edit.zone_id.options.length <= 1) {
      if (document.account_edit.state.value == '' || document.account_edit.state.value.length < <?php echo ENTRY_STATE_MIN_LENGTH; ?> ) {
         error_message = error_message + "<?php echo JS_STATE; ?>";
         error = 1;
      }
    } else {
      document.account_edit.state.value = '';
      if (document.account_edit.zone_id.selectedIndex == 0) {
         error_message = error_message + "<?php echo JS_ZONE; ?>";
         error = 1;
      }
    }
  }
<?php
  }
// ******************************************************************
//
// ******************************************************************
   if ((ACCOUNT_PHONE == 'true') && (ACCOUNT_REQUIRED_PHONE == 'true')) {
?>
		if (document.account_edit.elements['telephone'].type != "hidden") {
			if (telephone == '' || telephone.length < <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>) {
			error_message = error_message + "<?php echo JS_TELEPHONE; ?>";
      		error = 1;
    		}
  		}
<?php
  }
// ******************************************************************
//
// ******************************************************************
   if ((ACCOUNT_FAX == 'true') && (ACCOUNT_REQUIRED_FAX == 'true')) {
?>
		if (document.account_edit.elements['fax'].type != "hidden") {
			if (fax == '' || fax.length < <?php echo ENTRY_FAX_MIN_LENGTH; ?>) {
			error_message = error_message + "<?php echo JS_FAX; ?>";
      		error = 1;
    		}
  		}
<?php
  }
// ******************************************************************
//
// ******************************************************************
?>

  if (document.account_edit.elements['password'].type != "hidden") {
    if ((password != confirmation) || (password == '' || password.length < <?php echo ENTRY_PASSWORD_MIN_LENGTH; ?>)) {
      error_message = error_message + "<?php echo JS_PASSWORD; ?>";
      error = 1;
    }
  }

  if (error == 1) {
    alert(error_message);
    return false;
  } else {
    return true;
  }
}
//--></script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -