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>
    
    
    
     
  • 相关阅读:
    xyplorer设置备忘
    如何在CentOS 8上安装Python2 Python3
    为CentOS 8操作系统安装MySQL的方法,以安装MySQL 8为例
    SSH登录服务器报ECDSA host key "ip地址" for has changed and you have requested strict checking
    Linux常用命令大全
    转载:php的几种常用的数据交换格式
    转:GBK编码 VS UTF8编码
    转载:中文在UTF8和GBK编码中的范围
    转:SDL Specification and Description Language 简介
    转:Java中Split函数的用法技巧
  • 原文地址:https://www.cnblogs.com/zkwarrior/p/5138833.html
Copyright © 2011-2022 走看看