Start at the free tutorial,
http://www.w3schools.com/js/js_intro.asp.
What you are after is form validation and it can be done on your machine (and should be). The idea is to minimize any connection to the server.
There is a javascript forum here in codingforums.