Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Pre-fill HTML form information

Posted on 2004-03-31
2
Medium Priority
?
244 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Expert Comment

by:Andy
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 740 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
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 …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

705 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