Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello friends,


how i can user query string in java script?
i want to transfer value form one page to another page using query string in java

i have 3 text box and i want transfer these value to another page using java script.

how its can possible anybody have any sample code for plz reply me asap.
Posted

The following Javascript code will fulfill your requirement:
JavaScript
var value1 = document.getElementById("textBox1").value;
var value2 = document.getElementById("textBox2").value;
var value3 = document.getElementById("textBox3").value;
location.href = "AnotherPage.aspx?val1=" + value1 + "&val2=" + value2 + "&val3="+value3;
 
Share this answer
 
Comments
Uday P.Singh 1-Oct-11 6:13am    
correct my 5!
You can redirect to a different page like this,

JavaScript
function move() {
       window.location = 'http://www.yourdomain.com'; // At the end concat with parameters. 
}


You can get the textbox values in JS as follows,

JavaScript
document.getElementById(id).value


where id is your actual control id.
 
Share this answer
 

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