Prepopulating a form (Full Version)

All Forums >> [Web Development] >> ASP, PHP, and Database



Message


webgyrl -> Prepopulating a form (10/28/2009 18:54:27)

I am trying to allow my users to search for a company and once they find it be able to select it and it takes them to a form where it is
prepopulated with name of the company so they can rate them instead of having to enter the name manually...using asp and frontpage...help




TexasWebDevelopers -> RE: Prepopulating a form (10/29/2009 9:29:07)

Pass the company name as a hidden variable to the next page and then stick it into the value bit of the form text box.
Here is a primer on passing variables from page to page with code...
http://www.texaswebdevelopers.com/examples/passingvariables/




bobby -> RE: Prepopulating a form (10/29/2009 15:35:27)

TWD, what a great primer / example of how to do exactly what they asked. Nice tidbit!

The other part of the equation here is how they select a company from a list... the easiest way is to make each search result a link containing the company name as a variable passed to the next page... something like:

<a href="page.asp?coname=COMPANY" >COMPANY</a>

Then you can populate the form field with the variable "coname" on page.asp

It is not hidden, but then again your visitor is selecting the company name from a list so who cares if they can see it in the URL?

Just another way to pass the data once selected...

[;)]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625