/    Sign up×
Community /Pin to ProfileBookmark

retrieve values in the previous page

I am trying to develop a demo version of our system with ONLY HTML pages and without any JSP, Java or webserver. Its a demo version to show the screen flows.There is a “Back” href link in each successive pages.

How can I retrieve the submitted form values if I click “Back” and go to the previous page (to display prefilled values) ?
I have to ise ONLY HTML and Javascripts.

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@RJ2003authorJan 14.2004 — ANYBODY ?
Copy linkTweet thisAlerts:
@PittimannJan 14.2004 — Hi!

I suppose you are NOT working with popup windows. If your pages have to be displayed in the same window, you can pass the values from page to page in the url (hope this would be ok for you) and the "Back" links should use the same method to transfer the values back to the previous page. They would not be normal hrefs, but js function calls and the functions would have to "construct" the href including the form values...

It will require some scripting, but is absolutely possible.

Cheers - Pit
Copy linkTweet thisAlerts:
@RJ2003authorJan 14.2004 — Thanks Pit.

Being new to JS, I may ask some stupid questions.

How do you associate a js function with href link ?

<a href=javascript: createURL()> BACK </a> ???????

How will this createURL() function retrieve form data and create a URL ?
Copy linkTweet thisAlerts:
@PittimannJan 14.2004 — Hi!

Imagine, the two variables are form data:
[code=php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript" type="text/javascript">
<!--
var value1="abc";
var value2="def";
function createURL(){
location.href="passValues2.htm?firstValue="+value1+"&secondValue="+value2;
}
//-->
</script>
</head>
<body>
<a href="javascript:createURL()"> BACK </a> ???????
</body>
</html>
[/code]

Clicking the link will open passValues2.htm with the two values in the url which can be processed there...

If you play around with that and use the code you can find here:

http://javascript.internet.com/forms/passing-values-source.html

you will be on the way to solve your problem.

If the short information, I provide here is not sufficient, just post again (I don't know, whether you are experienced with form stuff).

Cheers - Pit

Edit: Sorry, I forgot - please remove the space between "java" and "script" in the a tag with the href...
Copy linkTweet thisAlerts:
@FangJan 14.2004 — If a user presses the "Back" button of the browsers window the current information will be lost.

If you use cookies, any information entered can be saved without loss.

Further, if child windows are used (your other posting), it will not matter if one is closed by the user.
×

Success!

Help @RJ2003 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.25,
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,
)...