Fixed syntax errors in JS

Still unable to submit the page, 400 BAD REQUEST error.