JavaScript - Taking input from HTML form and processing it with JavaScript