I've written a very basic function for practice, but I can't get it to work with form elements. I'm always getting "undefined" instead of values.

Could anyone please help?

Here's my file on Dropbox.

I am a novice in Javascript and beginner in programming in general, so please make your explanation as detailed as possible