Setting ASP.NET control property using jquery script
<p>I'm trying to set new value for asp.net control property when I check a checkbox.</p>

<p>In my case I have RegularExpressionValidator asp.net control and when I check the box I would have new value for the properties ErrorMessage and ValidationExpression.</p>

<p>I tried this code but did not work with me.</p>

<p>please help.</p>

<p>here is my code:
...............................................................................</p>

<pre><code>&lt;script src="js/jquery-1.4.1.js" type="text/javascript"&gt;&lt;/script&gt;

&lt;script type="text/javascript"&gt;

    function chkinput() {


        if ($('#&lt;%=chkIntphoneHome.ClientID %&gt;').is(':checked')) {

            $('#&lt;%=REV_HomePhone.ClientID %&gt;').attr('ErrorMessage', 'new msg');
            $('#&lt;%=REV_HomePhone.ClientID %&gt;').attr('ValidationExpression', 'new exp'); 
        }
    }

 &lt;/script&gt;
&lt;asp:CheckBox ID="chkIntMobileHome" runat="server" Style="position: absolute; top: 200px;
                    left: 535px;" Text="Internation Code" AutoPostBack="True"
                    /&gt;
&lt;asp:TextBox ID="txtHomePhone" runat="server" Style="top: 147px; left: 543px; position: absolute;
                    height: 22px; width: 128px" &gt;&lt;/asp:TextBox&gt;
                &lt;asp:RegularExpressionValidator ID="REV_HomePhone" runat="server" ErrorMessage="Please enter valid Home Phone"
                    Style="position: absolute; top: 177px; left: 476px; width: 226px;" 
                    Display="Dynamic" ControlToValidate="txtHomePhone"
                    ValidationExpression="\d{3}?\d{3}\d{4}"&gt;&lt;/asp:RegularExpressionValidator&gt;
</code></pre>
