zoukankan      html  css  js  c++  java
  • RadioButton如何隐藏和替换

    http://q.cnblogs.com/q/60738/

    用Jquery写的,可以实现隐藏功能,代码如下:

    
    
     1 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JqueryRadioButton.aspx.cs" Inherits="HtmlAgilityPackHtml.JqueryRadioButton" %>
     2 
     3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     4 
     5 <html xmlns="http://www.w3.org/1999/xhtml">
     6 <head runat="server">
     7     <title>点击RadioButton</title>
     8     <script src="jquery-1.5.2.min.js" type="text/javascript"></script>
     9     <style type="text/css">
    10         .hideclass 
    11         { 
    12         display:none; 
    13         } 
    14     </style>
    15    <script type="text/javascript" language="javascript">
    16        $(function () {
    17            $("#RadioButton1").change(function () {
    18                $("#tr1").removeClass("hideclass");
    19                $("#tr2").addClass("hideclass");
    20            })
    21 
    22            $("#RadioButton2").change(function () {
    23                $("#tr1").addClass("hideclass");
    24                $("#tr2").removeClass("hideclass");
    25            })
    26 
    27        });
    28     </script>
    29 </head>
    30 <body>
    31     <form id="form1" runat="server">
    32     <div>
    33        <table>
    34          <tr>
    35            <td>链接类型:</td>
    36            <td colspan="2">
    37              <asp:RadioButton ID="RadioButton1" runat="server" Text="图片链接" GroupName="rdo"  Checked="true"/>&nbsp;
    38              <asp:RadioButton ID="RadioButton2" runat="server" Text="文字链接" GroupName="rdo"  />
    39            </td>
    40          </tr>
    41          <tr id="tr1">
    42            <td><asp:Label ID="Label1" runat="server" Text="链接图片:"></asp:Label></td>       
    43            <td>
    44                <asp:FileUpload ID="FileUpload1" runat="server" />
    45                <asp:Button ID="Button1" runat="server" Text="上传" />
    46            </td>
    47          </tr> 
    48          <tr id="tr2" class="hideclass">
    49            <td><asp:Label ID="Label2" runat="server" Text="文字链接:"></asp:Label></td>       
    50            <td>
    51             <asp:TextBox ID="TextBox2" runat="server" ></asp:TextBox>
    52            </td>
    53          </tr> 
    54        </table>
    55     </div>
    56     </form>
    57 </body>
    58 </html>
    
    
    
     
  • 相关阅读:
    API下载文件
    c# 测试网络连接
    C# Word 插入签名图片
    c# word文档合并
    c# 文件筛选
    e
    基本初等函数(Basic elementary function)
    前端性能优化学习
    解决点击穿透的最佳实践
    ObjectARX通过选定的实体获取所有组名示例
  • 原文地址:https://www.cnblogs.com/zkwarrior/p/5138833.html
Copyright © 2011-2022 走看看