Fix $ reference for elements that are not direct children of form.

Also did XXX, switched $.each to forEach.