Changed form completion function to only consider errors when the error div is visible.