You might need to change the id you're searching for to:

   $(document).ready(function() {
       $("#aspnetForm").validate({
         debug: true
       });
   });

The ID in your code behind always gets changed to 'aspnetForm'.

You can check in firebug to make sure you're using the correct ID of
the form.

J

On Feb 13, 3:27 pm, Jörn Zaefferer <joern.zaeffe...@googlemail.com>
wrote:
> You can add the debug-option for debugging:
>
>    $(document).ready(function() {
>        $("#form1").validate({
>          debug: true
>        });
>    });
>
> Make sure the all necessary files are loaded (via Firebug).
>
> Jörn
>
> On Fri, Feb 13, 2009 at 4:17 PM, expresso <dschin...@gmail.com> wrote:
>
> > Here is my code.  I have the reference to the javascript in my Master Page 
> > so
> > it's definitely there and I am getting no JavaScript errors when checking it
> > out with Firebug.
>
> > The problem I have is when I click submit, it's doing a postback, it's not
> > firing the validate method:
>
> > <asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder"
> > runat="server">
>
> > <script type="text/javascript">
>
> >    $(document).ready(function() {
> >        $("#form1").validate();
> >    });
>
> > </script>
> > <div class="webform">
> >    <form id="form1" runat="server">
> >    <table>
> >        <tr>
> >            <td width="250"><div class="formfieldlabel"><em>*</em>Background
> > Color</div></td>
> >            <td width="150">
> >                <div class="formfield_radiobuttonlist"><asp:RadioButtonList
> > ID="rblBackgroundColor" CssClass="radiobuttonlist"
> > repeatdirection="Horizontal" runat="server" /></div>
> >            </td>
> >        </tr>
> >        <tr>
> >            <td width="250"><div class="formfieldlabel"><em>*</em>First
> > Name</div></td>
> >            <td width="150">
> >                <div class="formfield"><asp:TextBox class="required"
> > width="150" ID="txtFirstName" runat="server" /></div>
> >            </td>
> >        </tr>
> >        <tr>
> >            <td>
> >                <table width="100%" cellpadding="0" cellspacing="0">
> >                    <tr><td><div
> > class="formfieldlabel"><em>*</em>Nickname</div></td></tr>
> >                </table>
> >            </td>
> >            <td width="150">
> >                <div class="formfield"><asp:TextBox class="required"
> > width="150" ID="txtNickname" runat="server" /></div>
> >            </td>
> >        </tr>
> >        <tr>
> >            <td colspan="2">
> >                <div class="formrow_right">
> >                    <table cellpadding="0" cellspacing="0">
> >                        <tr>
> >                            <td width="190">
> >                                 <div class="formrow_right"><asp:ImageButton
> > OnClick="btnAddToCart_Submit" ID="btnAddToCart"
> > ImageUrl="~/images/addtoCartpng" runat="server" /></div>
> >                            </td>
> >                        </tr>
> >                    </table>
> >                </div>
> >            </td>
> >        </tr>
> >    </table>
> >    </form>
> > </div>
> > </asp:Content>
> > --
> > View this message in 
> > context:http://www.nabble.com/Trouble-with-Validation-Firing-in-ASP.NET-tp219...
> > Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to