asp.net + Custom validator not validating
<p>I am trying to use a customvalidator to validate a DIV form and then close it if there is no validation errors. Below is my code, I can't get my custom validator to work, when I click submit, nothing validates, not sure what's wrong. Please advice. Thanks.</p>

<pre><code>function validateRedemptionDialog(src, args) {

                var rDate = document.getElementById('&lt;%=uitxtRedemptionDate.ClientID%&gt;').value;


                if (rDate == "") {
                    args.IsValid = false;
                    return;
                }
                args.IsValid = true;
            }


function closeRedemptionDialog() {
            $('#dialog_Active_Redemption_confirm').dialog('close');
        }   

&lt;div id="dialog_Active_Redemption_confirm" style="display: none"&gt;
                &lt;div class="section_body"&gt;
                    &lt;div class="section_body_content"&gt;

                        &lt;div class="row"&gt;
                            &lt;asp:Label runat="server" ID="uilblRedemptionDate" Text="&lt;%$ Resources:MembersNContactsManagerResources, uigrdhdrTransDate %&gt;"
                                CssClass="label"&gt;
                            &lt;/asp:Label&gt;
                            &lt;asp:TextBox ID="uitxtRedemptionDate" runat="server" CssClass="text DatePicker" Style="width: 120px;
                                margin-right: 2px;"&gt;
                            &lt;/asp:TextBox&gt;
                        &lt;asp:CustomValidator ID="ctvtxtCamDateEnd" runat="server" ClientValidationFunction="validateRedemptionDialog"
                        ControlToValidate="uitxtRedemptionDate" ErrorMessage='&lt;img src="../Images/icons/error.png" style="vertical-align:middle"/&gt; XXX!'
                        Font-Names="arial" Font-Size="X-Small" SetFocusOnError="True" Display="Dynamic" /&gt;
                        &lt;/div&gt;

                        &lt;div class="row"&gt;
                            &lt;asp:Label runat="server" ID="uilblRedemptionAmountSpent" Text="&lt;%$ Resources:MembersNContactsManagerResources, uilblRedemptionAmountSpent %&gt;"
                                CssClass="label"&gt;
                            &lt;/asp:Label&gt;
                            &lt;asp:TextBox ID="uitxtRedemptionAmountSpent" runat="server" Style="width: 120px;"&gt;
                            &lt;/asp:TextBox&gt;         

                        &lt;/div&gt;
                        &lt;div class="row"&gt;
                            &lt;ul class="inline" style="margin-left: 137px; padding: 3px;"&gt;
                                &lt;li&gt;&lt;span class="button grey_btn"&gt;
                                    &lt;%--Submit button--%&gt;
                                    &lt;asp:Button ID="uibtnRedemption" runat="server" Text="&lt;%$ Resources : MembersNContactsManagerResources, uilblSubmit %&gt;" OnClientClick="javascript:closeRedemptionDialog();"/&gt;
                                    &lt;span&gt;&amp;nbsp;&lt;/span&gt; &lt;/span&gt;&lt;/li&gt;
                            &lt;/ul&gt;
                        &lt;/div&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
</code></pre>
