I placed the HTML from this site into a Stacks stack. I placed the javascript from site into the Javascript tab of the HTML inspecter … no joy. Then, I placed the javascipt into the Head tab of the HTML inspector, putting tags around the script. Still no joy. In both cases, I examined the page source code and everything looked ok.
The JS provided on that page looks up elements by ID, but the HTML provided assigns the field a name and not an id. They are not interchangeable. Using ID is correct. They used the correct HTML in their page, but provided incorrect HTML for you to copy. Try this HTML: