you can use two kinds of approach.
1. use global JS variables, include the variables in a JS file and refer those files in both the pages.
Ex: create test.
js
Code:
// filename.js
var test1;
var test2;
then refer this
JS file in both the pages.
in the first page, set the variables after your validation.
in the second page retrieve the values from the variable.
2. use Query string(this is better and easy).
query strings are the name value pairs which are passed in the url itself.
eg: _http://test.com/submitpage.html?key1=value1&key2=value2
here is a sample for accessing query strings using Javascripts.
Code:
var qsParm = new Array();
function qs() {
var query = window.location.search.substring(1);
var parms = query.split('&');
for (var i=0; i<parms.length; i++) {
var pos = parms[i].indexOf('=');
if (pos > 0) {
var key = parms[i].substring(0,pos);
var val = parms[i].substring(pos+1);
qsParm[key] = val;
}
}
}
Source for #2