[jQuery] Validate() error - "jQuery(a).data is not a function" ?
<HTML >
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY >
<DIV>
<TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0"><!-- Letter Heading -->
<TBODY>
<TR>
<TD><!-- Left margin -->
</TD>
<TD>
<DIV><FONT face="Trebuchet MS" size=2><SPAN class=338112314-10082007>Hi all,
</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN class=338112314-10082007>I have a
form, generated with php, which spits out a number of sets of fields (title,
forename, surname etc.), which I need to validate. However, because I don't know
how many sets of field there might be, i can't use the rules/messages as I
usually do:</SPAN></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT face="Trebuchet MS"
size=2>$("#booking-stage-2").validate({<BR> event:
"blur",<BR> errorClass:
"required",<BR> errorLabelContainer:
$("#errors"),<BR> wrapper: "li",<BR> rules:
{<BR> g12_title_1:
"required"<BR> },<BR> messages:
{<BR> g12_title_1: "Please choose a
title."<BR> }<BR> });</FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2></FONT> </DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN
class=338112314-10082007>"g12_title_1" would be from 1 to an unknown
number.</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN
class=338112314-10082007></SPAN></FONT> </DIV>
<DIV><FONT face="Trebuchet MS" size=2><SPAN class=338112314-10082007>I therefore
want to use validate in it's simple form as <SPAN class=338112314-10082007><FONT
face="Trebuchet MS">$("#booking-stage-2").validate();, and put the requirements
inline as class="{required:true}". However, adding <SPAN
class=338112314-10082007><FONT
face="Trebuchet MS">$("#booking-stage-2").validate(); to my script brings up the
error </FONT></SPAN></FONT></SPAN></SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS"><FONT size=2>"jQuery(a).data is not a
function" <SPAN class=338112314-10082007>in the console window of FireBug.
Can anyone shed some light on what this means, or where I'm going wrong? I can't
see why it would fall over on such a simple example. I can give access to the
live page if needed, but it's not for general consumption
yet...</SPAN></FONT></FONT></DIV>
<DIV><FONT face="Trebuchet MS"><FONT size=2><SPAN
class=338112314-10082007></SPAN></FONT></FONT> </DIV>
<DIV><FONT face="Trebuchet MS"><FONT size=2><SPAN class=338112314-10082007>This
is all with jQuery 1.1.3 and validate() 1.1</SPAN></FONT></FONT></DIV>
<DIV><FONT face="Trebuchet MS"><FONT size=2><SPAN
class=338112314-10082007></SPAN></FONT></FONT> </DIV>
<DIV><FONT face="Trebuchet MS"><FONT size=2><SPAN
class=338112314-10082007>Thanks,</SPAN></FONT></FONT></DIV><FONT
face="Trebuchet MS" size=2>
<P align=left><B>Luc Pestille</B><BR>Web Designer</P></FONT>
<DIV> </DIV></TD>
<TD><!-- Right margin -->
</TD>
</TR><!-- Disclaimer -->
<TR>
<TD COLSPAN="3"><BR>
<DIV STYLE="FONT-SIZE: 7pt; COLOR: gray; FONT-FAMILY: verdana" ALIGN="justify">
<FONT COLOR="silver">
</FONT> </DIV>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
<DIV STYLE="FONT: 10px/1.4 verdana,arial; COLOR: #aaaaaa"><IMG STYLE="MARGIN: 10px 0px" HEIGHT="100" ALT="in2 is part of the BWP Group" SRC="cid:dc9ba77fa7@b92e44b0-4eca" WIDTH="600" BORDER="0">
<P>in2, Thames House, Mere Park, Dedmere Road, Marlow, Bucks, SL7 1PB<BR>tel: +44 (1628) 899700 | fax: +44 (1628) 899701 | email: <A HREF="mailto:sales@in2.co.uk">sales@in2.co.uk</A> | web: <A HREF="http://www.in2.co.uk/">www.in2.co.uk</A></P>
<P>This message (and any associated files) is intended only for the use of jquery-en@googlegroups.com and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not jquery-en@googlegroups.com you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Messages sent to and from us may be monitored. Any views or opinions presented are solely those of the author jquery-en@googlegroups.com and do not necessarily represent those of the company. </P>
</DIV></BODY></HTML>