The first part of your question is the easiest. In your form on the first page use the "GET" method to submit to your action (or next) page.
This will pass the variable using the url string:
whateveryoursiteis.com/formActionPage.htm?testVariable=testVariablevalue
The second part of your question is a little more involved. To start off, the most common way to grab information from the "GET" method is to use a server side laguage such as PHP, ASP, CF, PERL, ETC. However you can get this passed value by parsing the url string using JavaScript. Below are the two pages required to do so followed by a demonstration link and an additional explanation link.
formPage.htm
formActionPage.htm
CLICK HERE FOR DEMO
After creating this I searched for an additional detailed explanation for you. This explains it well and if you notice his method isnt far from the one I used.
http://www.htmlgoodies.com/beyond/jspass.html