title: mask for asp text box using jquery
body: <p>I'm trying to mask text box with 2 different masks when a check box has been checked using jquery.</p>
  
  <p>I tried my code with html text box and html check box and it is working ok but when I tried my code with asp text box and asp check box there is no response.</p>
  
  <p>any advice???</p>
  
  <p>here is my code:  </p>
  
  <pre><code> &lt;%@ Page Title="" Language="C#" MasterPageFile="~/Imam.Master" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="Imam_Contacts.WebForm4" %&gt;
  &lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"&gt;
  
  &lt;script src="js/jquery-1.4.1.js" type="text/javascript"&gt;&lt;/script&gt;
  
  
      &lt;script src="js/jquery.maskedinput-1.2.2.js" type="text/javascript"&gt;&lt;/script&gt;
        &lt;script type="text/javascript"&gt;
  
            $(document).ready(
  
  function() {
  
      $('#chkhtml').click(
  
   function() {
       if ($('#chkhtml:checked').length &gt; 0) {
           $("#txthtml").mask("999-99-9999");
       } else {
           $("#txthtml").mask("99/99/9999");
       }
   });
  
  });
  
  $(document).ready(
  
  function() {
  
      $('#chkasp').click(
  
   function() {
       if ($('#chkasp:checked').length &gt; 0) {
           $("#txtasp").mask("999-99-9999");
       } else {
           $("#txtasp").mask("99/99/9999");
       }
   });
  
  });
      &lt;/script&gt;
  
  
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt;
      &lt;asp:CheckBox ID="chkasp" runat="server" /&gt;
      asp:&lt;asp:TextBox ID="txtasp" runat="server"&gt;&lt;/asp:TextBox&gt;
      &lt;input id="chkhtml" type="checkbox" checked="checked" title="chkhtml"  /&gt;HTML &lt;input id="txthtml" type="text" /&gt;&amp;nbsp; 
  
  &lt;/asp:Content&gt;
  </code></pre>