Karl,
I choose to keep my original approach as it was better for code
clarity in my case.

>From within my function, I could select the text input passed as
argument with variable $currentField.
I could also get the list of other text inputs located after it.
$afterFields.length correctly counts the number of those fields.

Now, for each of those text fields I must access the status of the
checkbox located just after.

Instead of ".each()", I would like to use a for loop since the loop
must be exited as soon as a checked checkbox is found.

I've been unable to access the checkbox.

function UpdateFooter(caller) {
(skip)

var $currentField = ":text[name=" + caller.name + "]";
var $afterFields = $($currentField).parent().nextAll().find(":text");

// Use a for loop instead of a ".each()" handler.
var n = $afterFields.length;
if ( n > 0) {  // If there are text fields located after the current
text field.
    for (var i=0; i<n; i++) {
        alert($('$afterFields[i]~:checkbox').checked);  // Does not
work.
    }
}

(skip)
}  // end of function

Reply via email to