Needed to find the parent form of a form element. This answer on StackOverflow gave me the right answer.