Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa HTML PASS value
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


vasanth periasamy
PASS value
1 Answer(s)      3 years and 9 months ago
Posted in : HTML


javascript to pass value to other html file


Advertisement
View Answers

April 7, 2011 at 11:06 AM


1)values.html:

<html>
<script>
function send(){
var f=document.form;
var fname=f.firstname.value;
var lname=f.lastname.value;
window.location.replace("passvalues.html?f="+fname+"&&l="+lname);
}
</script>
<form name="form" action="passvalues.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 colspan=2><input type=button value="Submit" onclick="send();">
</td>
</tr>
</table>
</form>
</html>

2)passvalues.html:

<html>
<script>
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();
</script>
<script>
firstname = unescape(params["f"]);
lastname = unescape(params["l"]);

document.write("Firstname = " + firstname + "<br>");
document.write("Lastname = " + lastname + "<br>");

</script>


Related Tutorials/Questions & Answers:
PASS value
PASS value  javascript to pass value to other html file
you pass a variable by value.
you pass a variable by value.  How do you pass a variable by value... $a = &$b /*--------------Pass By value----------------*/ function add($a) { return ++$a; } add($a); /*---------------Pass by reference
Advertisements
objective c pass by value
objective c pass by value   How to pass value by reference...; //j now == 23, but this hasn't changed the value of i. } If you wanted to be able to modify i, you would have to pass the value of the reference by doing
pass by value /reference - Java Beginners
pass by value /reference  hello sir/mam, i know pass by value is a primitive type in java. what about pass by reference in java ? .. For object type pass by value is used or pass by reference is used ? pls give me a example
How to pass value of a link to a textfield
How to pass value of a link to a textfield  Dear Sir, in my project I'm initially making a value of the textfield as a link. Now, I want to pass the value of the link in the textfield after clicking the link and dont want to open
How do you pass a variable by value?
How do you pass a variable by value?  How do you pass a variable by value
Java Pass Value Example
Java Pass Value Example       Pass value from JSP to JavaScript We can also pass the value from a JSP page to the java script as we have done in our
i want to pass Javascript value to JSP scriptlet..
i want to pass Javascript value to JSP scriptlet..  i am having... that i am calling the onchange function. In javascript i am getting the value now i want to pass this value to JSP scriptlet
In Struts 2 how to pass the <s: property value=''
In Struts 2 how to pass the s: property value'  In Struts 2 how to pass the s: property value' I have page where i display the list of treasury, their names. I need to have them as hyperlinks ans on click of A treasury name i
How to pass value from dijit.Tree to dijit.MenuItem - Ajax
How to pass value from dijit.Tree to dijit.MenuItem  Hi Friends, I... with the menu. But I want to pass the value of an item to its menu item and when user will clik on that menu, the value should be shown like Delete Instead
How to pass the value from controller to jsp page ?
How to pass the value from controller to jsp page ?  HI I need to pass the value from controller to jsp. I use the way like this Controller request.setAttribute("msg", "Successfully Login"); In jsp ${msg} and then i
How to pass the value of Selected Value of combo box into sql ??
How to pass the value of Selected Value of combo box into sql ??  My SQL Database Name is MHS, user=root, password=admin,table name is sub_comb(regno,sname,sgen). Now i want to select one "regno" from Combobox and then after
write a program to demonstrate call by value and call by reference.(pass objects as parameters)
write a program to demonstrate call by value and call by reference.(pass objects as parameters)  write a program to demonstrate call by value and call by reference.(pass objects as parameters
how to value of one variable pass in other variable in revetse order
how to value of one variable pass in other variable in revetse order  Like variable a=367 b must have valuev763
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... a function hello() which takes value from the jsp page on click of some button
Pass value from child to parent window
Pass value from child to parent window       Java example program to pass value from child window... and will take the value to pass it on to the parent window. Here is the code
Pass value of rasio button from jsp page to action class(not conventional problem)
Pass value of rasio button from jsp page to action class(not conventional...;table border="1"> <tbody> <s:iterator value...; <td><s:property value="#id.startTime" /></td>
Example program to pass value from Html to java script
Example program to pass value from Html to java script       We can also pass the values from... which will pass the value to the java script function and this value
JSP Value to JavaScript
to pass the value from JSP to JavaScript. The JavaScript create a function..., we are going to pass the jsp value to javaScript. For this we have create...; <html> <head> <title> Pass value from JSP
Pass by Reference - Java Beginners
Pass by Reference  Hi Friends, What is Pass by value and Pass by Reference?can u please explain with examples.is java supports Pass by reference?  Hi Friend, Pass By Value: It refers to pass the variables
Can I pass a
Can I pass a   Suppose I have servlet named Name.java and there is a variable String name holding a value "Roseindia". I have collected the value to Getname.jsp via ajax. Now how can I pass this value to scriplet without page
java pass by reference
java pass by reference  i understood java always pass arguments by pass by value so that the original value does not change...... but i want to know how we change the value and make it effect the original value by passing
pass parameter names and values
pass parameter names and values  What is the <jsp:param>...;jsp:include> or <jsp:forward> to pass parameter names and values... is as follows: <jsp:param name="paramName" value="paramValue"/>
Is Java pass-by-reference?
Is Java pass-by-reference?  Is Java pass-by-reference
pass method reference in java
pass method reference in java  How to pass method reference in Java
JavaScript pass arguments
JavaScript pass arguments   How to pass dynamic arguments to the functions in JavaScript
PHP Pass Post Data
PHP Pass Post Data  How to pass POST data to the PHP-CGI
Pass message controller to viiew with the help of Model in Spring 3
Pass message from Controller to View with help of Model in Spring 3.0: In this example, we will discuss about the pass message or different types of value...:out value="${nameerror}"/></FONT></td> <
onclick pass variable - JSP-Servlet
onclick pass variable  on button onclick event pass variable and print in textbox in same page... i want to pass value of variable at onclick event of button and also want to print it in textbox in same page....  Hi
Pass value from iframe to parent
Pass value from iframe to parent   ... page. We can pass values from iframe to the parent page with the use of java script.  Here in our example of passing value from iframe to the parent we
pass to next page
pass to next page  I am working on a school project no server client side only. 1st page you enter data such as name, address, DoB etc.(textboxes & dropdowns) after clicking submit the data needs to be displayed in a frame
 

 

 

DMCA.com