Thanks - the examples made it a lot clearer, I almost feel stupid for not realising how easy it is, and having tried RC1 now, I can't see me ever using any other validation.
Last question, and might require it's own thread; using TinyMCE and your plugin, I have to click the submit button twice to get the form to submit - TinyMCE copys it's iframe(?)/div contents back to it's textarea on the first submit I think, but is empty before that. Can I envoke TinyMCE's 'copy' function before the field is checked somehow? Or should I just check TinyMCE's iframe(?)/div content? Has anyone else used TinyMCE and your plugin successfully? Thanks, Luc -----Original Message----- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jörn Zaefferer Sent: 22 May 2007 22:16 To: jquery-en@googlegroups.com Subject: [jQuery] Re: Validation function help request Luc, > Hi Jörn, > I'd like to use your plugin, and I was up to a point, but the problem > I'm having is three-fold. I'm sure it can be solved with your plugin, > and I'd love to know how; > > Ideally I'd like an example to get me started - assuming a select dropdown > (#jobtype) with two options ('a', 'b') hiding/showing two relevant <div>s > (#div-a #div-b) with a text field in each, what do I need in order for the > input in #div-b to NOT be required when #div-a is shown, and #div-b is hidden? > > I'm sure it's possible, but it's not documented as I need it on your site. > there are two example available that show how to build depdencies (second and third example jQuery.validator.methods.required): http://jquery.bassistance.de/api-browser/plugins.html#jQueryvalidatormethodsrequiredStringElementBooleanStringFunction From what you describe, this should be enough: //on input in div-a {required:'#div-a:visible'} //on input in div-b {required:'#div-b:visible'} Of course you can switch that: //on input in div-a {required:'#div-b:hidden'} //on input in div-b {required:'#div-a:hidden'} That's it. Just provide a selector using jQuery's expression capabilites. The plugin itself adds ':blank' and ':filled' to check for filled or blank fields (trimming whitespace). -- Jörn Zaefferer http://bassistance.de In2 Thames House Mere Park Dedmere Road Marlow Bucks SL7 1PB Tel 01628 899700 Fax 01628 899701 e: [EMAIL PROTECTED] i: www.in2.co.uk 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 [EMAIL PROTECTED] and do not necessarily represent those of the company.