Check if element is within form before removing