單選框(radio)之onclick事件的實現


第一部分:

<table width="410" border="0" align="center" cellpadding="0" cellspacing="0" >
     <tr>
         <td width="26"><input name="db" type="radio" checked="checked" onclick="res(1)"/></td>
         <td width="87" align="left">效率類指標</td>
         <td width="25"><input name="db" type="radio" onclick="res(2)"/></td>
         <td width="93" align="left">卷煙類指標 </td>
         <td width="25"><input name="db" type="radio" onclick="res(3)"/></td>   
         <td width="154" align="left">煙葉類指標</td>
     </tr>
 </table>

 

第二部分:

<script type="text/javascript">

function res(cs)
{  
       var param;
       if(cs == 1)
       {
          param = "one";
       }
       if(cs == 2)
       {
          param = "two";   
       } 
       if(cs == 3)
       {
          param = "three"; 
       }
       $.ajax({
                   url:"<c:url value='/t_sys_kanban/duibiao11/'/>"+param,
                   type: "post",
                   dataType: "text",
                   error: function(){
                   alert("Error loading XML document"); 
     },
     success: function(data)
     {  
             var tab = data;
             document.getElementById("chartdiv11").innerHTML = tab;
     }
 });
 }</script>

 

第三部分:

<div id="chartdiv11">


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM