3
我試圖掩蓋與2個不同的面具文本框時複選框已經使用jQuery檢查ASP文本框。面膜使用jQuery
我想我與HTML文本框和HTML複選框代碼,它好的工作,但是當我嘗試我的代碼以ASP文本框和ASP複選框沒有反應。
任何建議???
這裏是我的代碼:
<%@ Page Title="" Language="C#" MasterPageFile="~/Imam.Master" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="Imam_Contacts.WebForm4" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script src="js/jquery-1.4.1.js" type="text/javascript"></script>
<script src="js/jquery.maskedinput-1.2.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(
function() {
$('#chkhtml').click(
function() {
if ($('#chkhtml:checked').length > 0) {
$("#txthtml").mask("999-99-9999");
} else {
$("#txthtml").mask("99/99/9999");
}
});
});
$(document).ready(
function() {
$('#chkasp').click(
function() {
if ($('#chkasp:checked').length > 0) {
$("#txtasp").mask("999-99-9999");
} else {
$("#txtasp").mask("99/99/9999");
}
});
});
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:CheckBox ID="chkasp" runat="server" />
asp:<asp:TextBox ID="txtasp" runat="server"></asp:TextBox>
<input id="chkhtml" type="checkbox" checked="checked" title="chkhtml" />HTML <input id="txthtml" type="text" />
</asp:Content>
謝謝,這幫了我 – SheldonH 2012-06-12 14:05:40