Thankyou both for the reply, that's exactly what I was looking for.How do I put the for statement inside the if statementtrying thisvar oRows = xfa.resolveNodes("Body.Table.Row[*]"); if ($.boundItem(xfa.event.newText) == "stephenw@babybunting.com.au") {for (var i = 0; i < oRows.length; i += 1) { ...