Updated javascript to clear form field