#475: form_validator.js, shorten code