[jQuery] Can a ThickBox appear over the top of my Flash content?
Since the link in the thickbox QA is broken, could someone explain how I can make my thickboxes appear over the top of my flash content? Thanks in advance!
[jQuery] Re: Radio button validation
Thanks for the response. I went with the first option and placed a custom error label manually in the HTML, and it works great. On May 25, 6:44 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: There still is that positioning problem with radio buttons and checkboxes. Currently you have two far-from-perfect options: Place the error label for that group in the HTML (see the second example on the demo page), or use the errorPlacement-option to override the default positioning (insertAfter element, see custom-methods-demo). In case the element is completely ignored and the form is submitted as valid, there may be another problem. You should at least see an error label inserted behind the first radio input. An example page of your setup may help. -- Jörn Zaefferer http://bassistance.de
[jQuery] Radio button validation
I've got a bunch of radio buttons, all with the name type and all with different id's (type1, type2 etc.), and for some reason the validate plugin doesn't protest when I don't select a radio button, and I don't get any javascript errors either. Here's the code: $(#addForm).validate({ focusInvalid: false, event: blur, rules: { type: { required:true } }, messages: { type: Please choose type } }); - And here's the html label for=type1 input type=radio name=type id=type1 value=1 /Type 1 /label label for=type2 input type=radio name=type id=type2 value=2 /Type 2 /label - Anyone got a clue? Thanks!
[jQuery] Re: Validate optional field
Thanks a lot! :) On May 14, 3:48 pm, Dan G. Switzer, II [EMAIL PROTECTED] wrote: I'm trying to validate an optional field with the validation plugin, using a custom method. Here's the code: rules: { birthdate: { validBirthdate:true } }, messages: { birthdate: { validBirthdate: Invalid birthdate } } How do I make this field optional? I only want to check the birthdate if the user has provided one. (I'm aware of the date method, but I'm purposely using a custom method). This is going to be controlled by your custom function. If you look at Jörn's built in validation methods, you'll see he validates the field if the field is also required: rangeLength: function(value, element, param) { var length = jQuery.validator.getLength(value, element); return !jQuery.validator.methods.required(value, element) || ( length = param[0] length = param[1] ); }, You can use the same approach in your custom validation, or you can just pass back true if the field is blank to say it passes validation. -Dan
[jQuery] Validate optional field
I'm trying to validate an optional field with the validation plugin, using a custom method. Here's the code: rules: { birthdate: { validBirthdate:true } }, messages: { birthdate: { validBirthdate: Invalid birthdate } } How do I make this field optional? I only want to check the birthdate if the user has provided one. (I'm aware of the date method, but I'm purposely using a custom method).
[jQuery] Variable in selector
I'm trying to hide an image, and I have the id of that image in a variable (imgToShow). Here's what I'm trying: $(#+imgToShow).show(); This is not working. What am I doing wrong?
[jQuery] Re: Variable in selector
That unfortunately hides the whole page. It goes completely blank in both FF and IE7. :-( On Apr 11, 9:44 am, [EMAIL PROTECTED] wrote: [BDY.TXT]try this: $(function() { $('#' + imgToShow + '').hide(); }) -Original Message- From: andreas [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 11, 2007 3:19 PM To: jquery-en Cc: andreas Subject: [jQuery] Variable in selector I'm trying to hide an image, and I have the id of that image in a variable (imgToShow). Here's what I'm trying: $(#+imgToShow).show(); This is not working. What am I doing wrong?
[jQuery] Re: Variable in selector
Don't worry about this. My original code does work, but there was a css rule the interfeared. Thanks for the help! On Apr 11, 12:12 pm, Oddish [EMAIL PROTECTED] wrote: That unfortunately hides the whole page. It goes completely blank in both FF and IE7. :-( On Apr 11, 9:44 am, [EMAIL PROTECTED] wrote: [BDY.TXT]try this: $(function() { $('#' + imgToShow + '').hide(); }) -Original Message- From: andreas [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 11, 2007 3:19 PM To: jquery-en Cc: andreas Subject: [jQuery] Variable in selector I'm trying to hide an image, and I have the id of that image in a variable (imgToShow). Here's what I'm trying: $(#+imgToShow).show(); This is not working. What am I doing wrong?
[jQuery] Best practice for image source change
I've got a bunch of thumbnails, and when clicking these thumbnails, a larger image is supposed to change. I do this by changing the src attribute of the larger image, but I'm very new to jQuery so I was wondering about the best way to accomplish this. Right now, I've got this working code, but maybe it can be optimized? I wrap each thumbnail with a link: a href=javascript:; id=tnLink01img src=thumbnail01.jpg alt= //a This is the amateurish jQuery code I've conjured up: $(a#tnLink01).click(function() { $(#mainImage).attr({src:another_large_image.jpg}); }); I'll need one of these functions for every thumbnail and that seems wrong somehow, so I'd really appreciate any helpfil tips and strategies for switching a larger image when clicking thumnails.