An interesting problem I'm SURE someone can solve (not me!)


I have a bunch of questions I ask visitors.

Depending on their answer to one question, different NEXT questions are asked…so each user’s set of questions could be unique.

The problem is this…
say that a user answers 5 of 20 questions, then while in the middle of answering question 5, they click a hyperlink on the page and leave the question-page. if they then go back to the question-page, I need to keep track of what they had been typing for question 5 before they had left.

But when they do return to question 5, all their text in the form inputs is erased. How should I best keep it?

Please email me any help you can offer…I’m sure someone has come across this problem and can solve it! So many intelligent people here…



Actually, that is … basically, not able to be solved. Unless maybe you had javascript code that redirected the page to a script that stored your variables as session vars, then redirected them back to the page they clicked on. That would be a lot of work to code, however, and probably wouldn’t work half the time anyway. What it boils down to is one key point:

If your users are stupid enough to partially fill out a form and then click on a hyperlink to go somewhere else, they deserve to have their information lost.

Now, if you are talking about storing the information that has already been submitted to you for the next time the user goes to the questions, that is simple. First decide if you need it to be stored when the user goes offline or not. If not, just store everything as session variables. If yes, set a cookie, and store the information in a database or a text file.


Tarential… I’ve seen this done on websites before, but it is done through javascript/php or asp as the case seems fit. You can browse through different pages (clicking on a hyperlink) and any new information you change is automatically remembered. The actual submit button finally updates the database, but their are about 10 pages of other information that you can edit/update before actually saving it. Not sure how this was done though… maybe setting cookies with javascript? If I remember corectly in javascript their is a way to tell when the mouse/curser leaves a text box, and when this happens is when it executes and “remembers”…

Ideas? Obviously I am no expert, just a suggestion.

What do you think? Can It Be Done?


Oh, wait… you mean, what I just said?


drewbee, i think you have something there, when the textbox loses focus, save a cookie or something



Couldn’t be that I already said that… no… did neither of you read my post?


eh I did, lol sorry bout that. Something about the way you worded it maybe?


“If yes, set a cookie” seems pretty straightforward to me. I don’t know where you are from or what language you speak natively, but I doubt there is anyone here who doesn’t understand that.


Ok first, calm the attitude… do you enjoy going around these forums and fighting with people or what?

2nd I was reading it through rather quickly, hence why I didn’t pick up on it. He missed it too, so I must not be the only one.

Alot of times, and I mean this in the best possible way, I skip over and fail to read posts you have made as I dislike how your “style” is of communicating on the boards. Very cocky I think. But as Is, it was a simple mistake, or are we Mr. Perfect over their as well too?

I do find you to be very inteligent, but maybe the way you present yourself needs some work.


And you speak of not liking my attitude? I haven’t been insulting you. Perhaps you should show the same courtesy.

Forgive me for getting to the point and not coddling people uselessly. Programming is NOT EASY, for the most part. It can be, of course, but most easy stuff isn’t useful, and is just something we must do to get to the good parts. However, if someone cannot do the easy, menial part, and do it well, their future scripts are going to fail. I know what other instance you speak of, and he should have grabbed that error a hundred times over before posting it to the forums. You know it. I answered hard so that he learns to problem solve for himself. You think he’ll just come back here next time he has a stupid problem? No! He’ll research it first, just as all the mods here and the FAQs advise you to do. To be a good programmer, you must be able to learn for yourself. You must know that. If you feel like posting a huge reply to people like him every time they have a small problem, then by all means do it! Don’t let me get in your way. I’m not taking away your right to answer. I gave him help, and thats more than you gave him.



Not to get into the middle of a flame war, but there’s a difference between asking a kid to lookup a word in the dictionary and scaring the bejeezus out of him so he never cares about words. I know when I was first learning I had some problems with concepts that I find are easy now, and it’s pretty easy to forget how difficult any new language can be. Giving someone enough information to help them without writing their code is not always easy. You both tried to help. But, like people here love to tell those looking for script advice or a paid coder, “You’re in the wrong place.” This isn’t the place for an ego contest or insult-slinging flame war. I’m sure some Yahoo groups would love to hear it, but most people here just want a little coding help…

If those links on your page are editable, why not just have them open in a _blank window so that you don’t lose them from your site at all? Maybe even write a script that reads the link if it’s external and adds the target automatically (look at the Dialectizer)


ManiacalV, very simple solution, i like it!

Tarential seems like he’s got self-esteem issues.

any decent coder will try to make the most efficient use of their time, in this case the most efficient was to find people who have already solved this problem, rather than recreating the wheel

I guess tarential wasn’t bright enough to see maniacalv’s solution!



This coming from someone who has 3 posts here and doesn’t know me from Adam. Cheers, dumbass.


Let me know when we are done being angry - It solves nothing. My apologies comp1921 for you getting caught in the middle of a pissing contest (though you did not need to throw fuel on the fire).


We’ll be done being angry when I’m through being insulted with no basis of thought.


By the way, it probably would have helped a whole hell of a lot if you hadn’t brought it back up again. Noone had replied to this in quite some time, and you dragged it back up. We don’t need stuff like that happening, its bad enough without you adding to it.