Solved

Pre-fill HTML form information

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP PDO get the error if exists 3 72
Collapseable list of URLs. 10 113
I starting with php 12 115
Where do I learn ES6? 3 50
When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
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 …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

920 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

17 Experts available now in Live!

Get 1:1 Help Now