Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Carrying a value from one form to another


  • Please log in to reply
12 replies to this topic

#1 jax

jax

  • Members
  • 11 posts
  • OFFLINE
  •  
  • Local time:08:06 PM

Posted 03 September 2004 - 11:29 AM

I'm hoping someone might be able to help me to find a way to carry a value entered in one html form to another page.

The idea is to form a progressive series of questions. Some may include identifying information so as to distinguish one respondent from another

Somewhere the user is asked to respond "Yes" or "No" to a certain question. When they submit that answer they go to another page which asks them a series of additional questions which will be different if they answered yes or no in the first place.

I want all the values from the questions answered up to the yes or not to be included in the new report I receive on the form input in the second form without the user having to enter those values again.

The idea for the need for this came when I was visiting a site dealing with cars. A form asked me to input the kind of car I drove from a drop down list, after I submitted that information I was taken to another page which asked me right off to input exactly the same information which I had just provided. What a way to tick off a user!

Is there a way to avoid this, especially if one is staying on the same site?

Jack

BC AdBot (Login to Remove)

 


#2 ColdinCbus

ColdinCbus

  • Members
  • 312 posts
  • OFFLINE
  •  
  • Local time:09:06 PM

Posted 03 September 2004 - 02:57 PM

The easiest way would probably be to use PHP and carry over the information through the URL to the next page unless you want to do a database or cookies.

#3 jax

jax
  • Topic Starter

  • Members
  • 11 posts
  • OFFLINE
  •  
  • Local time:08:06 PM

Posted 03 September 2004 - 03:20 PM

I don't know PHP, just HTML and a bit of Java. For the moment I can't use PHP on my server anyway.

Is there some way to do this Client Side? Your mention of cookies suggests it might be possible but I have no idea of how to implement it. If you have an idea could you give me a simple example of the code I'd use on the originating page and the second page where the value is to be picked up?

Thankx

Jack

#4 ColdinCbus

ColdinCbus

  • Members
  • 312 posts
  • OFFLINE
  •  
  • Local time:09:06 PM

Posted 03 September 2004 - 03:26 PM

Humm, let me think about that. I guess you could build the page display client side using java but it would take some programing.

Are you able to use cgi ?

Edited by ColdinCbus, 03 September 2004 - 03:31 PM.


#5 JEservices

JEservices

    helping hand


  • Members
  • 1,700 posts
  • OFFLINE
  •  
  • Location:Texas
  • Local time:07:06 PM

Posted 03 September 2004 - 05:17 PM

I have an idea on how to figure it out. I dont really know programming, but maybe this is a direction for you. Go to a site that works the way you want it to, right-click, and select view source. This will give you the HTML raw coding on it, in Notepad (by default). Scan though it to see how it is done.

A link for 20 questions is here. It is not exactly what you are looking for, but when you view source it, it does bring back an interesting result.
We are all curious like a cat. We wonder, we ask, we learn.
Please post back when a suggestion works, so that others may learn.

#6 JEservices

JEservices

    helping hand


  • Members
  • 1,700 posts
  • OFFLINE
  •  
  • Location:Texas
  • Local time:07:06 PM

Posted 03 September 2004 - 06:38 PM

After re-reading your post, I think I misunderstood your question.

Are you looking for a way in HTML that someone can pick from a drop-down list, make a choice, and then make another choice from another list, that would only apply to the choice that was already made? Ok-it is a little hard to explain in words. How about a visual?

(choice 1) Ford Chevy or Geo
(choice 2) Door handles

Customer one picked Ford, and ONLY Ford door handles appear for a 2nd choice.
Customer two picked Chevy, and ONLY Chevy door handles appear for a 2nd choice.
Customer three picked Geo, and ONLY Geo door handles appear for the 2nd choice.

Is that what you are looking to do?
We are all curious like a cat. We wonder, we ask, we learn.
Please post back when a suggestion works, so that others may learn.

#7 jax

jax
  • Topic Starter

  • Members
  • 11 posts
  • OFFLINE
  •  
  • Local time:08:06 PM

Posted 04 September 2004 - 12:05 PM

Re Coldin's question. No, I can't use CGI for now

Jason, the 20 question site does pose some interesting things but I don't think it will help here.

What I had in mind is using one form which will pick up some values that were provided by the previous page visited and incorporate those values without any input from the user.

For example I have two pages which review product A and product B. I ask the user on that page " Have you personally used this product?" and the user answers
  • Yes or
  • No
and presses "submit"

Now he arrives at another page which will be different depending on whether the answer was YES or NO, on which I ask a series of further questions. However, the form which I receive from this second page will contain, in addition to whatever values are entered by the user, 1) the Name of Product A or B, and 2) the Yes or No which was enered in the first form.

Its important that the Name of Product A or B be picked up and filled in from the referring page so that this second form can be used by an unlimited number of referring pages rather than having to have a separate form for each one.

I hope this makes sense to you.

Jack

#8 JEservices

JEservices

    helping hand


  • Members
  • 1,700 posts
  • OFFLINE
  •  
  • Location:Texas
  • Local time:07:06 PM

Posted 04 September 2004 - 03:32 PM

OK. I think your response allowed me to see what you are wanting to do.

In reference to my example, when someone choses Ford, they are brought to a page that already has Ford on the page. When someone choses Chevy, it has Chevy as the default. When someone choses Geo, Geo is posted in a box.

If that result is what you are looking to do, then there are many different ways that you can do it. The most popular and efficient way would be to have individual forms, with each choice, as a seperate website. When a customer makes a choice (Ford, Chevy, or Geo), then it is really just finalizing the link that points to the one that was already written.

The coding for this, is easier with a program designed to handle HTML coding. I would recommend that you take a look at Dreamweaver MX. It does have a 30-day free, full-function trial. Even though the full version is well over $300, the knowledge gained from the trial would be invaluable. One thing about this program though, it can be quite overwhelming on how complex it is.

Once you become more experienced with using this, you could go two different ways to continue using this type of tool. You could Google for free web authoring tools, or apply a little known trick on how to 'extend' the time on time-trial based programs. I could help you out on the latter.
We are all curious like a cat. We wonder, we ask, we learn.
Please post back when a suggestion works, so that others may learn.

#9 jax

jax
  • Topic Starter

  • Members
  • 11 posts
  • OFFLINE
  •  
  • Local time:08:06 PM

Posted 06 September 2004 - 07:43 AM

Thankx Jason,

Actually I was hoping to have one page, one web page collect all the information regardless of weather the user entered Ford, Chevy oor Geo. but the form report I received would hae a space in it which contained the value "Ford", "Geo, or "Cheyy", depending on which page the user had come from.

I want to avoid having the user needing to fill in that value, because the question was asked on the earlier page and I can just imagine a user ranting "What's going on here, I just answered that question. Why do I have to answer again? If these nerds are so dense that I have to answer every question twice, I'm going to take my business elsewhere ...." :thumbsup: Which is exactly what >> I << did when it happened to me.



Besides, I feel it is more efficient use of computer resources to have just one form instead of 250 that are the same. When we just have Ford, Chevy oand Geo it's not so bad but you can extrapolate the use of resources when we have a situation where there might be hundreds or thousands of referring pages.

Jack

#10 Grinler

Grinler

    Lawrence Abrams


  • Admin
  • 43,639 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:09:06 PM

Posted 06 September 2004 - 08:18 PM

Really the only way to have information pass through between pages is to usea CGI script of some sort. It is rare for a hosting company to not offer any CGI scripts at all. Are you sure you are not able to?

#11 jax

jax
  • Topic Starter

  • Members
  • 11 posts
  • OFFLINE
  •  
  • Local time:08:06 PM

Posted 07 September 2004 - 08:27 AM

Yes, I'm certain that for the moment CGI scripts are not an option where I've got the pages where I'm wanting to carry values forward.

I know it's a limitation so I was looking for some kind of workaround.

Can a person write and read cookies using JavaScript? This might be a solution, but I'm not that up on JS to know how to code it.

Jack

#12 Grinler

Grinler

    Lawrence Abrams


  • Admin
  • 43,639 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:09:06 PM

Posted 07 September 2004 - 12:25 PM

Yes you can use cookies with javascript, but remember if the user has javascript disabled, your app will be broken.

Read this article:

http://www.devshed.com/c/a/JavaScript/Usin...ith-JavaScript/

#13 jax

jax
  • Topic Starter

  • Members
  • 11 posts
  • OFFLINE
  •  
  • Local time:08:06 PM

Posted 07 September 2004 - 07:23 PM

Thanks,

I think this may get me going to where I want to.

Jack




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users