if(A) echo"tableA";
if(B) echo"tableB";

解决方案 »

  1.   

    <script language=javascript>
      function show_table()
      {
         for(i = 0; i < document.all.show_tb.length; i++){
             if( document.all.show_tb.options[i].selected )
     {
        if( document.all.show_tb.options[i].value == 'A'){
              document.all('tb_A').style.display = '';
     document.all('tb_B').style.display = 'none';
    }
    else if( document.all.show_tb.options[i].value == 'B'){
              document.all('tb_B').style.display = '';
     document.all('tb_A').style.display = 'none';
        }
    else
    {
              document.all('tb_B').style.display = 'none';
     document.all('tb_A').style.display = 'none';
    }
        break;
     }
         }
      }
    </script>
    <select name="show_tb" onchange="show_table()">
     <option value=""></option>
     <option value="A">A</option>
     <option value="B">B</option>
    </select>
    <div id="tb_A" style="display:none">
     <table>
      <tr>
        <td>test a</td>
      </tr>
     </table>
    </div>
    <div id="tb_B" style="display:none">
     <table>
      <tr>
        <td>test b</td>
      </tr>
     </table>
    </div>
      

  2.   

    问题以解决,多谢大家的支持,多谢piner(php&自由通)的程序代码!