• 国家,省,市,地区四级联动免刷新菜单


    今天搞了一个国家,省,市,地区四级联动免刷新菜单

    代码使用js编写

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <script language="javascript" src="common/city.js"></script>
    <script language="javascript" src="common/selectcity.js"></script>
    <style>
    .select2
    {
        border: 1px solid #7B7D7B;
          97px;
        height: 18px;
        clip: rect( 0px, 129px, 18px, 0px );
        overflow: hidden;
    }
    .select1
    { FONT-SIZE: 12px;
     font-family: Verdana, Arial, Helvetica, sans-serif, "宋体";
        position: relative;
        left: -2px;
        top: -2px;
         100px; 
        line-height: 16px; color: #444444;
        border-style: none;
        border- 0px; 
    }
    </style>
    </head>

    <script language="javascript">
     function onChangeCity(formName,countryName,provinceName,cityName,areaName){
      var countryValue = eval(formName+"."+countryName).value;
      var provinceValue = eval(formName+"."+provinceName).value;
      if (countryValue != 0){
       if (provinceValue != 0){
        city.innerHTML = showCitySelect(formName,countryName,provinceName,cityName,areaName,countryValue,provinceValue,'');
        var cityValue = eval("add3code_"+provinceValue);
        if (cityValue == ""){
         area.innerHTML = showAreaSelect(areaName,provinceValue,'');
        }
       }else{
        city.innerHTML = showCitySelect(formName,countryName,provinceName,cityName,areaName,countryValue,'','');
       }
      }else{
       city.innerHTML = showCitySelect(formName,countryName,provinceName,cityName,areaName,'','','');
      }
     }
     function onChangeArea(formName,cityName,areaName){
      var cityValue = eval(formName+"."+cityName).value;
      if (cityValue != ""){
       area.innerHTML = showAreaSelect(areaName,cityValue,'');
      }
     }
     function initCity(formName,countryName,provinceName,cityName,areaName){
      
       city.innerHTML = showCitySelect(formName,countryName,provinceName,cityName,areaName,'1','19','190');
       area.innerHTML = showAreaSelect(areaName,'190','');
     }
    </script>

    </head>
    <body onLoad="javascript: initCity('pub_info','country','provetion','city','area');">

    <form action="" method="post" name="pub_info">
     <span id="city"></span><span id="area"></span>
    </body>
    </html>

  • 相关阅读:
    web自动化学习1--环境搭建以及web初识
    python接口自动化之openpyxl学习
    python接口自动化之requests学习
    接口自动化面试
    面试基础-linux
    git的使用
    php_PDO的事务处理和异常处理
    PHP_PDO简单操作
    PHP_MySql扩展主要操作
    Linux_使用yum快速安装、配置amp环境
  • 原文地址:https://www.cnblogs.com/see7di/p/2240133.html
Copyright © 2020-2023  润新知