Question

Passing information from one page to another

Asked by: l_deus_l

I have four pages that ask three - to four questions each...i need to have the questions on different pages...I do not have a server support, I am only using client side scripting...Is there a way I can save the data that the person is using on the local hard drive in any form to analyze the answers after the person has gone through my questions...I am essentially looking at data retrieval from the series of the questions, but strictly on a client side only...Please help me...

l_deus_l

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2003-07-16 at 17:29:28ID20680916
Tags

page

,

passing

,

another

,

from

Topic

JavaScript

Participating Experts
5
Points
500
Comments
14

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Passing recordsets between pages
    Currently I'm using session variables to store recordset objects so I can access them in other pages. Is there a way to pass the recordset from one page to the other without session variables?
  2. Faulty RAID Controller? or strictly the work of the devil?!…
    System: Gigabyte GA-&DPXDW Mobo (400W PS) ATI Radeon 8500 All In Wonder (128meg edition) Generic 4 Port 1394/Firewire Card Generic 56k winmodem Generic 1.44 floppy Genius Netscroll + mouse - though I was going to say Generic? :) NEC MultiSync LCD 1700V Altec Lansing ATP...
  3. passing the ID from a datagrid and retrieving it on a second …
    I have a datagrid on the main page when the user clicks on a hyperlink in a row. I need to pass the ID to the link.aspx page and then retrieve the other values from the data base on the link page. Based on the ID clicked. <asp:HyperLinkColumn Text="More Info" T...
  4. passing an array and retrieving that array
    i already have values in my array. the problem is how can i pass it to another page and how will i retrieve it from that page. e.g. i have an array arr[] how will i pass it and then retrieve it.thanks. a code will be much appreciated. can i use this? <input type="hi...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: thirdPosted on 2003-07-16 at 17:39:30ID: 8939049

 

by: sciwriterPosted on 2003-07-16 at 17:42:04ID: 8939062

Simple enough to do through cookies, just write a value to a cookie for each question, then repeat for each page.  When the analysis time comes, retrieve the cookie values, analyze the results.  In your case, it would be courteous to automatically delete the cookies after the Q/A session is done, and tell the user so.

If you object to using cookies, no point going further, but if you don't mind, can point to to cookie routines.
Logic a bit unusal at first, but once you get used to it, is the only accepted way to write to a user's hard drive.

Let me know

 

by: sciwriterPosted on 2003-07-16 at 17:46:14ID: 8939085

Exactly what I said, that page uses cookies.

 

by: thirdPosted on 2003-07-16 at 17:49:44ID: 8939100

 

by: abuimadPosted on 2003-07-16 at 17:51:33ID: 8939113

Use a frameset.
Lets say your four pages that ask questions are: Page1.htm, Page2.htm, Page3.htm, and Page4.htm.
Lets say ResultPage.htm is the final page that processes the answers.

Use an extra page for saving answers; call it saver.htm, which look somthing like this:
<html>
<head>
<script>
 var answer1, answer2, answer3, answer4;
</script>
</head>
<body></body>
</html>

You start with a frameset as follows:

<frameset rows="0,*" frameborder="NO" border="0" framespacing="0">
    <frame src="saver.htm" name="topFrame" scrolling="NO" noresize >
    <frame src="Page1.htm" name="mainFrame">
</frameset>

This way saver.htm will not be visible, but you can use it to store the user's answer.

For example, if each page take the answer and store it in a javascript variable called userAnswer:
Page1.htm would use the following script to store the answer:

parent.frames[0].answer1 = userAnswer;

Page2 stroes its answer in the answer2 variable, and so

Finally, the result page retrives the answers using:

parent.frames[0].answer1 // for answer1
parent.frames[0].answer2 // for answer2
parent.frames[0].answer3 // for answer3
parent.frames[0].answer4 // for answer4

Hope that work out for you.
Post back any questions

Good luck
 

 

by: sciwriterPosted on 2003-07-16 at 17:55:22ID: 8939137

That's another good option, Abuimad, about the only other multi-page option.

 

by: davlun20080Posted on 2003-07-16 at 20:41:27ID: 8939816

How about updating the form action tag with a querystring comprised of all the form elements and their values, then on the next page, split the search parameter of the url in javascript into their respective name/value pairs and then write out to the html hidden fields to hold the values.

THen on submit of page two, do the same, and so on.

On the last page, you have all the values you need, process away.  No cookies, no frames.

David

 

by: davlun20080Posted on 2003-07-16 at 20:42:25ID: 8939824

I can provide code to retrieve the search string, split it and then write it out to the document if you need that help.

David

 

by: abuimadPosted on 2003-07-16 at 21:08:21ID: 8939951

What davlun20080 suggested works too.
You can just use a form with a get method and it will encode the parameters in name/value by itself when submit.
Make sure to use the unescape function when retriving.

 

by: sciwriterPosted on 2003-07-16 at 21:31:05ID: 8940070

Agreed, but through 4 sequential pages?  Don't you think deus might get lost in it?
I suggested the parameter passing on another question, but only from page 1 to page 2.
Anyway, Davlun, give it a shot!  I'd love to see it.

 

by: alambresPosted on 2003-07-17 at 04:39:23ID: 8941563

Hi!

I don't like the cookies solution, maybe the client doesn't accept'em. deus, in my opinion the best solution is Abuimad's, I would do this in the same way, anyway if you don't like frames here's a solution regarding David's way, that is passing parameters through the URL and get them in the next page. It is:

********************page1***********************************

<HTML>
<HEAD>
<TITLE></TITLE>

<script type="text/javascript">
      function send(objForm)
      {
            var strParamString = '';
            var sep = '?';
            for (i=0;i<objForm.elements.length;i++)
            {
                  strParamString = strParamString + sep + objForm.elements[i].id + '=' + escape(objForm.elements[i].value);
                  sep = '&';
            }
            location.href = 'Page2.htm' + strParamString;            
            
      }
</script>
</HEAD>
<BODY>

<form id="f" name="f">
      <input id="txt1">
      <input id="txt2">
      <input id="txt3">
      <input id="txt4">
</form>
<input value="send data" type="button" onclick="send(document.f);" id="btnSend">
</BODY>
</HTML>

**************page2****************

<HTML>
<HEAD>
<TITLE></TITLE>
<script type="text/javascript">
      function getParam()
      {
            var arrayParam = location.href.toString().split('?')[1].split('&');
            var paramName, paramValue;
            for(i=0;i<arrayParam.length;i++)
            {
                  paramName = arrayParam[i].toString().split('=')[0];
                  paramValue = arrayParam[i].toString().split('=')[1];
                  eval ('var ' + paramName + ' = "' + paramValue + '";');
            }
            alert (txt1);
            alert (txt2);
            alert (txt3);
            alert (txt4);
      }
</script>

</HEAD>
<BODY onload="getParam();">


</BODY>
</HTML>



***********************************

if you like this way, I can also give ya a function that get all params and makes the string to send'em to the next page, just in order to i.e. not loose the page1 paramaters when passing form page2 to  page3

however, I would do Abuimad's solution!!

hope it helps ya

alambres

 

by: l_deus_lPosted on 2003-07-17 at 06:57:21ID: 8942676

I like Abuimad's sugesstion, but I cannot use frames...We are doing a research on web design usability and we already have a series of websites ready to be tested (all non-frame versions)...except for the javascript shopping cart that i am using in these sites(which is the only framed segment of the whole site).

I prefer the solution by dalvun and alambres...Instead of alerts, is there a way I can save the data into hidden variables and let the user go through the site and when he is done, we could retireve the data.

The experiment is going to be like this:

The subject gets a task, he goes throught the site and searches information and answers the question, then he is redirected to the home page and given another task...the cycle goes on for 5 times...We need to have the data stored while the user is browsing other sections...Is it possible?

if not, then I guess, we will have to simplify the experiment, but then it is not worth the effort at all and I would nto like ot give up on it after comign so far...If not , I would accept solution by alambres, however, I need to figure out how to get those parameters into hidden variables, which i hope is not rocket science.

Thanks a zillion guys, for being such a great help.

l_deus_l

 

by: alambresPosted on 2003-07-17 at 07:24:31ID: 8942929

hi!
You do not need hidden fields, since you aren't gonna submit the form, but you can store the values in JS variables. The alerts are just to show that the variables are full!!

look at this:


<HTML>
<HEAD>
<TITLE></TITLE>
<script type="text/javascript">
      var paramString = location.href.toString().split('?')[1];
      function getParam()
      {
            var arrayParam = paramString.split('&');
            var paramName, paramValue;
            for(i=0;i<arrayParam.length;i++)
            {
                  paramName = arrayParam[i].toString().split('=')[0];
                  paramValue = arrayParam[i].toString().split('=')[1];
                  eval ('var ' + paramName + ' = "' + paramValue + '";');
            }
      }
      
</script>

</HEAD>
<BODY onload="getParam();">


</BODY>
</HTML>


this is a new version for Page2. You have all parameters in "paramString" variable, ready to concat to the URL
i.e:

to go to supposed page3 you shoold do:

location.href = "page3.htm?" + paramString;

this way you add to the URL the new parameters the user enters. But you NEED to add this line to ALL pages you wanna let the user visit without losing the answers:

var paramString = location.href.toString().split('?')[1];

I understand it could be annoying if there are much pages to change. But it will work.

When you wanna retrieve the values you just have to call getParam function, and you'll have the answers in the variables called like the field where the user entered the answer. Of course, the field names should be unique.


alambres

 

by: alambresPosted on 2003-07-17 at 07:27:09ID: 8942955

thanks a lot & good luck!

alambres

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...