[jQuery] Re: Validation function help request
Luc Pestille wrote: 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. Glad to hear that. 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? I don't have any experience with that yet, though I have another report that says that validating textareas is broken in RC1. Maybe those are related. -- Jörn Zaefferer http://bassistance.de
[jQuery] Re: Validation function help request
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 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.
[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 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
[jQuery] Re: Validation function help request
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; 1. This validation is for an admin system where the forms are automatically built, and there's no way to specify which generated fields have the class requirements, so I was addingthe calss {required:true} to all fields generated. 2. However, some fields are hidden/shown dependent on choices in dropdowns, so I need to be able to filter out their requirement dependent on a choice the user has made (and ideally reset the hidden value to ""). 3. I'd like to be able to specify and control all the validation from the .js file where all my other jQuery scripts are kept. None of the error messages need to be customised over what is generated automatically. Ideally I'd like an example to get me started - assuming a select dropdown (#jobtype) with two options ('a', 'b') hiding/showing two relevant 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. Thanks, Luc Pestille Web Designer -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jörn Zaefferer Sent: 21 May 2007 21:49 To: jquery-en@googlegroups.com Subject: [jQuery] Re: Validation function help request Luc, having written a pretty complete validation plugin I could give you quite a lot of tips on how to build one. But I tend to think that it makes much more sense if you could just tell me what need from the plugin and I could tell you how you can achieve that with my plugin. And in case it isn't possible yet, I'm sure we can figure out a nice solution. I've nearly finished the first release candidate of the plugin, with some interesting new features (that were requested at some point) and some heavy refactoring that removed all depedencies on IDs in a form. Let me know how we can get you going. -- 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.
[jQuery] Re: Validation function help request
Luc, having written a pretty complete validation plugin I could give you quite a lot of tips on how to build one. But I tend to think that it makes much more sense if you could just tell me what need from the plugin and I could tell you how you can achieve that with my plugin. And in case it isn't possible yet, I'm sure we can figure out a nice solution. I've nearly finished the first release candidate of the plugin, with some interesting new features (that were requested at some point) and some heavy refactoring that removed all depedencies on IDs in a form. Let me know how we can get you going. -- Jörn Zaefferer http://bassistance.de