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

Also switched $.each to forEach.