<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--function seladdr_onchange(obj) {
 if (obj.value =="2")
 {
document.all.table1.style.display ="none";
 document.all.table2.style.display ="";
 }
 else
 {
document.all.table2.style.display ="none";
 document.all.table1.style.display ="";
 }

}//-->
</SCRIPT>
<table id="table1">
 <tr>
  <td>111111<input type=text name=addr1></td>
 </tr>
</table><table id="table2" style="display:none">
 <tr>
  <td>222222<input type=text name=addr1></td>
  <td><input type=text name=addr2></td>
 </tr>
</table><select name=seladdr LANGUAGE=javascript onchange="return seladdr_onchange(this)">
 <option value="1">地址1</option> 
 <option value="2">地址2</option>
 <option value="3">地址3</option>
</select>

解决方案 »

  1.   

    <table name=table1 id=table1 bgcolor="#cccccc">
     <tr>
      <td><input type=text name=addr1></td>
     </tr>
    </table><table name=table2 id=table2 bgcolor="#663366" style="display:none">
     <tr>
      <td><input type=text name=addr1></td>
      <td><input type=text name=addr2></td>
     </tr>
    </table><select name=seladdr onpropertychange="changeBlock();">
     <option value=1>地址1</option> 
     <option value=2>地址2</option>
     <option>地址3</option>
    </select>
    <script>
    function changeBlock()
    {
      if(seladdr.options[seladdr.selectedIndex].value==2){
         table1.style.display='none'
         table2.style.display="block"
      }else{
         table1.style.display='block'
         table2.style.display="none"  
      }
    }
    </script>
      

  2.   

    <table id="t1" style="display:block">
     <tr>
      <td><input type=text name=addr1></td>
     </tr>
    </table><table id="t2" style="display:none">
     <tr>
      <td><input type=text name=addr1></td>
      <td><input type=text name=addr2></td>
     </tr>
    </table><select name=seladdr onChange="show(this)">
     <option>地址1</option> 
     <option>地址2</option>
     <option>地址3</option>
    </select><script>
    function show(s) {
     n = s.options.selectedIndex+1;
     for(i=1;i<=2;i++) 
       if(i==n)
         document.all["t"+i].style.display = "block";
       else
         document.all["t"+i].style.display = "none";
    }
    </script>