Click here to Skip to main content
15,886,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have 2 HTML pages and in the 1st HTML page there is a form with 2 textboxes & a submit button. I want to fill the form with some date & want to pass those values to the 2nd page. In the 2nd page those values to be stored in 2 different variables. These variables are intended to pass to the URL. This URL is at the below.

JavaScript
<script type="text/javascript" >
	var googleURL ='https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A76546294&dimensions=' + 'ga%3Asource&metrics=ga%3Ausers&sort=-ga%3Ausers&start-date='"+strStartDate+"'&end-date='"+strEndDate+"'&max-results=10';


These variable values should place as the strStartDate & strEndDate as dynamic values.

I am expecting an answer using AJAX & HTML 5.

Thanks,
Chiranthaka
Posted

1 solution

You will need 3 pages.

A parent page where the data will be stored between pages.
1st HTML page there is a form with 2 textboxes & a submit button
2nd page - Create URL page

From the parent page open 1st HTML page.
When submit is clicked save the values to the parent.
window.opener.hdnValueOne.value = document.getElementById('txtValueOne').value;

From the parent open page 2 and close page one.
Use window.opener.hdnValueOne.value to pull the value from the parent form.
 
Share this answer
 
Comments
Chiranthaka Sampath 21-Jul-14 23:21pm    
Can you post a sample source code? If can please.
SteveyJDay 22-Jul-14 10:46am    
I can write it and provide you code for a fee, but this site is about learning. Try if yourself, post the source code, and I will help you get it right.
Chiranthaka Sampath 22-Jul-14 22:47pm    
Ok pal thanx!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900