zoukankan      html  css  js  c++  java
  • 国家,省,市,地区四级联动免刷新菜单

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

    代码使用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>

  • 相关阅读:
    MySql 学习之 一条更新sql的执行过程
    MySql 学习之 一条查询sql的执行过程
    VUE基本介绍
    ESMAScript6基本介绍
    npm
    tensorflow2.0 评估函数
    网页引入mathjax,latex
    Veno File Manager
    tensorflow 测量工具,与自定义训练
    tensorflow自定义网络结构
  • 原文地址:https://www.cnblogs.com/see7di/p/2240133.html
Copyright © 2011-2022 走看看