<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD><BODY>
<form name="form1">
<input type="radio" name="intend" value="出租" id="rd1" checked="checked" />出租
<input type="radio" name="intend" value="出售" id="rd2"   />出售
</br>价格范围<select name="pricescope" style="width:96px" class="xialaliebiao" id="pricescope">
                      <option style="background:#F2F6FB" value="不限定" >不限定</option>
                      <option value="0-1000元/月">0-1000元/月</option>
                      <option value="1000-2000元/月">1000-2000元/月</option>
  <option value="50万元以下">50万元以下</option>
                      <option value="50-100万元">50-100万元</option>
                    </select>
</br>
信息来源<select name="listerStatus" style="width:96px" class="xialaliebiao" id="listerStatus">
                       <option value="业主出租">业主出租</option>
                       <option value="业主出售">业主出售</option>
                       <option value="承租人自用">承租人自用</option>
                       <option value="承租后合租">承租后合租</option>
                       <option value="承租后转租">承租后转租</option>
                       <option value="最终购买者">最终购买者</option>
                       <option value="授权代理">授权代理</option>
                       <option value="全权代理">全权代理</option>
                       <option value="独家全权代理">独家全权代理</option>
                       </select>
</form>
</BODY>
</HTML>现在想选择"出租"后“价格范围”只能选“不限定”,“0-1000元/月”,“1000-2000元/月”,信息来源只能选择前三项,如果选择“出售”,"价格范围"只能选择“不限定”,“50万元以下”,“50-100万元”,信息来源只能后五项。

解决方案 »

  1.   

    不管采用的那种技术,像这种问题应该很简单,只需要写段js代码就搞定了。
    fuction getValue(){
    var intend=document.forms[0].intend.value;
    var pricescope=document.forms[0].pricescope.value;
    var listerStatus=document.forms[0].listerStatus.value;
    if(intend.equals("出租")){
    document.forms[0].pricescope.value="不限定";由于时间紧,代码只简单的写到这,希望对你的解决问题的思路实施有点帮助,未完敬请见谅!!!
      

  2.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    <SCRIPT LANGUAGE="JavaScript">
    <!--
      var pricescope = new Array();
      var listerStatus = new Array();
      var j=0;
      function bodyOnLoad(){

        var length = document.getElementById("pricescope").options.length;
        for(var i=0; i<length; i++) {
          pricescope[i] = document.all("pricescope").options[i];
    }
        length = document.getElementById("listerStatus").options.length;
        for(var i=0;i<length; i++) {
          listerStatus[i] = document.all("listerStatus").options[i];
        }
    radioBtnOnClicked();
      }
      function rd1Checked(){
        document.getElementById("pricescope").options.length=1;
        for(var i=1; i<3; i++) {
          document.getElementById("pricescope").add(document.createElement("OPTION"));
          document.getElementById("pricescope").options[document.getElementById("pricescope").options.length - 1].text = pricescope[i].text;
          document.getElementById("pricescope").options[document.getElementById("pricescope").options.length - 1].value= pricescope[i].value;
        }
    document.getElementById("listerStatus").options.length=0;
     for(var i=0; i<3; i++) {
          document.getElementById("listerStatus").add(document.createElement("OPTION"));
          document.getElementById("listerStatus").options[document.getElementById("listerStatus").options.length - 1].text = listerStatus[i].text;
          document.getElementById("listerStatus").options[document.getElementById("listerStatus").options.length - 1].value= listerStatus[i].value;
        }
      }
      function rd2Checked(){
     document.getElementById("pricescope").options.length=1;
        for(var i=3; i<pricescope.length; i++) {
          document.getElementById("pricescope").add(document.createElement("OPTION"));
          document.getElementById("pricescope").options[document.getElementById("pricescope").options.length - 1].text = pricescope[i].text;
          document.getElementById("pricescope").options[document.getElementById("pricescope").options.length - 1].value= pricescope[i].value;
        }
    document.getElementById("listerStatus").options.length=0;
     for(var i=3; i<listerStatus.length; i++) {
          document.getElementById("listerStatus").add(document.createElement("OPTION"));
          document.getElementById("listerStatus").options[document.getElementById("listerStatus").options.length - 1].text = listerStatus[i].text;
          document.getElementById("listerStatus").options[document.getElementById("listerStatus").options.length - 1].value= listerStatus[i].value;
        } 
      }
      function radioBtnOnClicked(){
        if(document.all("rd1").checked==true){
      rd1Checked();
    }else if(document.all("rd2").checked==true){
      rd2Checked();
    }
      }
    //-->
    </SCRIPT>
    </HEAD><BODY onload="bodyOnLoad();">
    <form name="form1">
    <input type="radio" name="intend" value="出租" id="rd1" checked="checked" onclick="radioBtnOnClicked();"/>出租
    <input type="radio" name="intend" value="出售" id="rd2"   onclick="radioBtnOnClicked();" />出售
    </br>价格范?<select name="pricescope" style="width:96px" class="xialaliebiao" id="pricescope">
                          <option style="background:#F2F6FB" value="不限定" >不限定</option>
                          <option value="0-1000元/月">0-1000元/月</option>
                          <option value="1000-2000元/月">1000-2000元/月</option>
      <option value="50万元以下">50万元以下</option>
                          <option value="50-100万元">50-100万元</option>
                        </select>
    </br>
    信息来源<select name="listerStatus" style="width:96px" class="xialaliebiao" id="listerStatus">
                           <option value="?主出租">?主出租</option>
                           <option value="?主出售">?主出售</option>
                           <option value="承租人自用">承租人自用</option>
                           <option value="承租后合租">承租后合租</option>
                           <option value="承租后?租">承租后?租</option>
                           <option value="最???者">最???者</option>
                           <option value="授?代理">授?代理</option>
                           <option value="全?代理">全?代理</option>
                           <option value="独家全?代理">独家全?代理</option>
                           </select>
    </form>
    </BODY>
    </HTML>