Solved

Pre-fill HTML form information

Posted on 2004-03-31
2
226 Views
Last Modified: 2010-05-18
I have a page on my website that lists people in my office.  When they click on a link , it takes them to a form to fill in their contact info so that particular sales rep can get back in touch with them.  

The problem I have:  
How do I take that Saleperson's name from the page with the link, and when that next page containing the form pulls up have it automatically filled in on the form?

I'm willing to look at all options here, my server resources include cgi, java, jsp, php.

Thanks in advance!
0
Comment
Question by:NoelKent
2 Comments
 
LVL 6

Expert Comment

by:Reapz
ID: 10729289
Does each person have a link of their own? If so just make the link...

yourpage.php?name=theirname

And then retrieve ot on the next page with...

$name = $_GET['name'];

If they don't have a link each why not make a form with a dropdown menu with all the names in as both text and value. When the form is submitted you can get the values on the next page like this...

$name = $_POST['name_of_dropdown_menu'];

0
 
LVL 10

Accepted Solution

by:
frugle earned 185 total points
ID: 10730026
To put a lid on this, the code you're looking for is going to be something like:

[yourpage.php?name=theirname]

<HTML...
Salesperson: <input name="salesperson" type="text" READONLY value="<?php echo $_GET['name']; ?>" class="style">
.../HTML>

This will pre-fill the form with the value of "name" from the link on the previous page. The readonly part of the tag will stop the user from changing it.

hope this clarifies it.

Mike
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Programatically edit Web.config 8 39
How to i line up css containers from left to right 35 23
I starting with php 12 139
site launch date and last modified date 3 103
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question