Enhanced JS login validation