Enable the use of 'optional' on password fields (JavaScript part)

See ed0c10a10b0b3a9d9d898a64461de707026cd6d3