Solved

Pre-fill HTML form information

Posted on 2004-03-31
2
207 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

743 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now