Enter Password1:
Enter Password2:

The form attribute returns null if control in not within the context of form. Retrieve the second ELEMENT and examine its form element.