/    Sign up×
Community /Pin to ProfileBookmark

Sending data from one html to another

Hi i have a html form which has some input fields and submit button, what i want is when i submit this page, i want to display another page which will display the entered value. How will i do it using html or java script. Thanks
Input page
<html>
<HEAD>
<script language=”JavaScript” type=”text/javascript”>

function submitForm() {

}

</script>
</head>

<body >
<form>
First name:
<input type=”text” name=”firstname”>
<br>
Last name:
<input type=”text” name=”lastname”>

<INPUT TYPE=BUTTON width=100 VALUE=”Submit” STYLE=”font-size:8pt; background-color:#003399; color:#ffffff; font-weight: bold;” WIDTH=100 onClick=”submitForm()”>

</form>
</body>
</html>

//Display Page
<html>
<HEAD>
<script language=”JavaScript” type=”text/javascript”>

function submitForm() {

}

</script>
</head>

<body >
<form>
First name:

<br>
Last name:

</form>
</body>
</html>

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@UbikJan 06.2006 — [code=html]<form name="myFormName">
<input type="text" name="myFormFieldName">
</form>

<script language="JavaScript"><!--
var myVariableName = document.myFormName.myFormFieldName.value;
//--></script>[/code]
Copy linkTweet thisAlerts:
@alidar777authorJan 06.2006 — function submitForm() {

FN=document.forms[0].firstname.value;

LN=document.forms[0].lastname.value;

Out='';

Out+='<html>n';

Out+='<HEAD>n';

Out+='<title>echo</title>n';

Out+='</head>n';

Out+='<body>n';

Out+='<form>n';

Out+='First name:n';

Out+=FN;

Out+='<br>n';

Out+='Last name:n';

Out+=LN;

Out+='</body>n';

Out+='</html>n';

Pop=window.open('','echo');

Pop.document.write(Out);

Pop.document.close();
×

Success!

Help @alidar777 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...