Fix incorrect property in JavaScript validation method