Hi stack folk!
I'm working with jQuery.validate. One of its options is "success" where a function can be called upon valid user entry on a form. The only argument that can be passed is "label" which (as I understand) is a dynamically added label field to the right of the input element.
I need to perform a series of actions on a sibling "div" but I'm having enormous trouble trying to traverse to the div I want. I can't even find where the label is. Are there tricks to finding it?
I've used things such as alert (label.parents('.formrow').html());
and alert (label.parent().parent().parent().html());
and they all return "null" ... alert (label.html());
returns ""
Similar methods have worked for me in the past. Once I find something I then employ next()
or find()
and all is well. Is there another way?
PS. Example code:
success: function(label) {
errorspotholder = label.parents('.formrow').find('.rederrorx');
errorspotholder.removeClass('rederrorx').addClass('norederrorx').qtip('destroy');
},