Giovanni Battista Lenoci wrote:

Hi, i'm looking in API/1.1.2/DOM/Traversing section of the doc for what I'm tryng to do...

I think siblings() could be my function, but don't know how to use it..

I've a form like this:

<label for="test"></label>
<input id="test">
<label for="test"></label>
<input id="test2>

After the submit I do some server-side controls, then if there are errors I reload the page and in a hidden field I put the ids of the wrong fields.

Then in document ready I want to load those id and add a class to nearest(prev) label to change the color.

For example if the hidden field contains "test" I want to change the color of the first label.

If I'm understanding you right, once you have the ID you need, you could find the associated label via:

$("[EMAIL PROTECTED]").whatever().wherever();

Replacing test in the above with whatever the ID is.

Regards,
Michael Price

Reply via email to