First of all you need to get the HTML correct. There are so many errors in your code it won't work even with correct jquery.
Very quickly... You need to declare the type as an accepted type and give it a name. <input type="text" name="name" /> <input type="text" name="lastName" /> etc You've added spaced between attributes and values <form id="testform"> is correct but also needs action and method. <input type="button" onClick="validateDiv("1") /> should be <input type="submit" /> and jquery doesn't use onClick, using real javascript where I've written "stuff is true" $(document).ready(function(){ $('#testform').submit(function(){ if (stuff is true) return true; else return false; }); }); should do it, unless I'm very much mistaken. On Jul 17, 3:04 am, konda <[EMAIL PROTECTED]> wrote: > <form id = "testform"> > <div id ="1"> > <input type="name" /> > <input type="lastName" /> > <input type="phoneNumber" /> > > </div> > <div id ="1"> > <input type="address1" /> > <input type="address2" /> > > </div> > <input type="button" onClick="validateDiv("1") /> > </form> > > I need to validate the <div> data on the onClick. I will pass the div > id to validateDiv method. In the above scenario I need to validate > only the data that is there in first data. > > I appreciate if you could respond to this note. > > Thanks in advance ......