Anyone, please? I'm almost sure that this is a bug in Validation plugin by Jörn Zaefferer, which does not accept parent().parent() inside errorPlacement... can someone help me to fix this bug?
$(document).ready(function(){ $ ("#field1").parent().parent().next().find(">td:last").css("backgroundColor","#FF0000"); }); On Aug 27, 10:19 am, Feed <[EMAIL PROTECTED]> wrote: > Ok, there seem to be a bug somewhere.... look: > > Case 1 > > Code: > > errorPlacement: function(error, element) { > error.appendTo( element.css('backgroundColor','#000000') ); > } > > Result: > > FF: the error field is painted black (OK) > IE: the error field is painted black (OK) > > -------------------------- > > Case 2 > > Code: > > errorPlacement: function(error, element) { > error.appendTo( element.parent().css('backgroundColor','#000000') ); > } > > Result: > > FF: the TD containing the error field is painted black (OK) > IE: the TD containing the error field is painted black (OK) > > -------------------------- > > Case 3 > > Code: > > errorPlacement: function(error, element) { > error.appendTo( element.parent().parent().css('backgroundColor','#000000') ); > } > > Result: > > FF: the TR containing the error field is painted black (OK) > IE: the TD containing the error field is painted black > (WRONG) !!!!!!!!!! > > -------------------------- > > Conclusion: IE doesn't seem to understand the second .parent().... it > doesn't select the TR. What can I do to fix this? > > On Aug 24, 7:13 pm, Feed <[EMAIL PROTECTED]> wrote: > > > Jörn, > > > Since it's not working in IE, I've been trying other methods with no > > luck... things like: > > > error.appendTo( element.parent().parent().next().find("td:gt(0)") ); > > > or > > > error.appendTo( element.parent().parent().next().find("td:eq(1)") ); > > > ... > > > What do you think? Maybe a bug somewhere? It's strange that is only > > works in Firefox. > > > On Aug 24, 4:52 pm, Jörn Zaefferer <[EMAIL PROTECTED]> wrote: > > > > Feed schrieb:> What I need is this: > > > > > [IMG]http://i117.photobucket.com/albums/o71/feed_turbo/Misc/ > > > > jquery_validation.gif[/IMG] > > > > > I've tried several combinations but I can't achieve what I want. In > > > > theory this code should work, shouldn't it? > > > > > errorPlacement: function(error, element) { > > > > > error.appendTo( element.parent("td").next("td").next("td").next("td") ); > > > > } > > > > next() works only on a single tree branch, it can't "hop" to the next > > > table row. The first next("td") in your approach won't find any element, > > > because there is none in that row anymore. You need to traverse to the > > > parent row, to the next row, to the second td. This should do the trick: > > > > errorPlacement: function(error, element) { > > > error.appendTo( element.parent().parent().next().find(">td:last") > > > ); > > > > } > > > > Let me know if you need any other help with the plugin. And if the above > > > actually works I'll add an example to the docs, let me know what you > > > find :-) > > > > -- Jörn