passing textbox value from one page to another page using html n javascript
on button onclick event pass text box value and i want to pass value of variable at onclick event of button and also want to print it in textbox on the othe (next/prevoious)page
please help me
View Answers
February 14, 2012 at 1:03 PM
1)page1.html:
<html>
<form type=get action="page2.html">
<table>
<tr>
<td>First Name:</td>
<td><input type=text name=firstname size=10></td>
</tr>
<tr>
<td>Last Name:</td>
<td><input type=text name=lastname size=10></td>
</tr>
<tr>
<td>Age:</td>
<td><input type=text name=age size=10></td>
</tr>
<tr>
<td colspan=2><input type=submit value="Submit">
</td>
</tr>
</table>
</form>
</html>
2)page2.html:
<html>
<script LANGUAGE="JavaScript">
function getParams(){
var idx = document.URL.indexOf('?');
var params = new Array();
if (idx != -1) {
var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
for (var i=0; i<pairs.length; i++){
nameVal = pairs[i].split('=');
params[nameVal[0]] = nameVal[1];
}
}
return params;
}
params = getParams();
firstname = unescape(params["firstname"]);
lastname = unescape(params["lastname"]);
age = unescape(params["age"]);
document.write("firstname = " + firstname + "<br>");
document.write("lastname = " + lastname + "<br>");
document.write("age = " + age + "<br>");
</script>
</html>
February 16, 2012 at 1:27 AM
April 24, 2013 at 8:15 PM
if i set post="method" how can i send can any body please tell me
September 23, 2016 at 2:44 AM
How can we send the information from 1st page to 3rd r 4th r 5th page can you please explain me
Ads
Related Tutorials/Questions & Answers:
Advertisements
passing text value from pop up to parent page
passing text
value from pop up to parent page i want to pass
value of a
textbox of
one pop up window to its parent
page(
html). that parent
page contain a table. And i want to pass that text
value to
one cell in table of parent
passing data from one jframe to another
passing data
from one jframe to another I have two JFrame,built by
using the GUI Editor netbeans 6.9.i have to pass a data
from a Jtextfield...){
String
value=text.getText();
NextPage
page=new NextPage(
value
calling one jap page from another jsp page
calling
one jap
page from another jsp page i created a button in
one jsp
page i need to call
another jsp
page as an action to that button. so how can i call.. plz any
one explain. its urgent
to bring checked data from one page to another
to bring checked data
from one page to another thanks for your help... there is
one jsp
page , on it there is a link, on click of which it is opening second... fetching data
from the database on second jsp
page with checkbox corresponding each
How to redirect from a HTML page?
How to redirect
from a
HTML page? Hi,
Is it possible to redirect
from HTML page to
another page on the net? I have
one page and I want to redirect... to redirect to
another page using HTML code. You can use the following code:
<meta
Show Hyperlink in HTML Page
to connect
from
one page to
another page of the web. The anchor (<a>...<...
code show you a
HTML page, that create a link to
another page. The code begins...
Show Hyperlink in
HTML Page
 
Passing Parameters to Another JSP Page
Passing Parameters to
Another JSP
Page
By
using the include action we can pass the parameters
to
another jsp
page... in the jsp post
from the
html form or the jsp
page.
The code
Populate values from html to another html
Populate values
from html to
another html
In this tutorial, you will learn how to send values
from one html page to
another. Here, we have create a
html... on
another html page.
page1.html:
<html>
<form type=get action="
Pass value from JSP to JavaScript
Pass
value from JSP to
JavaScript
We can also pass the
value from a JSP
page to the java...
script
from the
HTML page. Since in JSP
page we can embed
HTML tags as well. 
HTML Login Page Code
using JavaScript. In this tutorial we
are creating a
HTML Login
page code...
JavaScript validation in
Login
page. We have set username and password
value... to create a login
page in
HTML and
validate user input with
JavaScript. View
Create HTML page using java
Create
HTML page using java Hi, I need to create an
html page to export some information. Currently, by
using java, i've exported information to excel. But now, I would like to view it in
HTML instead of excel. Is there any
How to check text in textbox using JavaScript
How to check text in
textbox using JavaScript How to check text in
textbox using JavaScript
I have a form in
HTML that contains text feilds and a submit button. The main purpose of this form is to take input
from user. My