Updated JS

Checked for blank (spacebar) entries with trim