HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 5th, 2009, 12:53 PM
Kathy Sutton Kathy Sutton is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 25 Kathy Sutton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 15 m 2 sec
Reputation Power: 0
Pre-filling HTML forms

I have a question of how I can transfer data entered by users on one web page to another.

I have two fields on a web page First Name and E-Mail Address that users populate. When they hit the submit button, they are directed to a more detailed form where the users enter data in several fields in addition to First Name and E-Mail address. I am trying to make this page user friendly so that users do not have to re-enter their First Name and E-Mail Address. How can I get the First Name and E-Mail Address fields to auto-populate in the second form page? Can this be done using HTML?

Reply With Quote
  #2  
Old June 5th, 2009, 01:11 PM
myndconsulting myndconsulting is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2009
Location: Davao City, Philippines
Posts: 27 myndconsulting New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 12 h 18 m 16 sec
Reputation Power: 0
Possible with PHP.

Reply With Quote
  #3  
Old June 5th, 2009, 01:35 PM
Kathy Sutton Kathy Sutton is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 25 Kathy Sutton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 15 m 2 sec
Reputation Power: 0
Pre-filling HTML forms

Both pages I have are in HTML. Is is possible to achieve this functionality without using PHP (i.e., just with HTML code)?

Reply With Quote
  #4  
Old June 5th, 2009, 01:39 PM
holodoc's Avatar
holodoc holodoc is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2004
Location: Kostolac, Serbia
Posts: 663 holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 15 h 59 m 52 sec
Reputation Power: 980
Send a message via Google Talk to holodoc Send a message via Skype to holodoc
Well you could do it with Javascript and cookies but its pretty much pointless to do it like that. A server side technology like PHP would be much better.
__________________
PHP Code:
<?php 
abstract class Ignorance extends Stupidity implements Unavoidable 
     public static 
$humiliation

     final function 
findCover(); 

?>

Reply With Quote
  #5  
Old June 5th, 2009, 02:16 PM
Skipt's Avatar
Skipt Skipt is online now
CSS Guru in Training
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2009
Location: Maryland, USA
Posts: 2,046 Skipt User rank is General 5th Grade (Above 100000 Reputation Level)Skipt User rank is General 5th Grade (Above 100000 Reputation Level)Skipt User rank is General 5th Grade (Above 100000 Reputation Level)Skipt User rank is General 5th Grade (Above 100000 Reputation Level)Skipt User rank is General 5th Grade (Above 100000 Reputation Level)Skipt User rank is General 5th Grade (Above 100000 Reputation Level)Skipt User rank is General 5th Grade (Above 100000 Reputation Level)Skipt User rank is General 5th Grade (Above 100000 Reputation Level)Skipt User rank is General 5th Grade (Above 100000 Reputation Level)Skipt User rank is General 5th Grade (Above 100000 Reputation Level)Skipt User rank is General 5th Grade (Above 100000 Reputation Level)Skipt User rank is General 5th Grade (Above 100000 Reputation Level)Skipt User rank is General 5th Grade (Above 100000 Reputation Level)Skipt User rank is General 5th Grade (Above 100000 Reputation Level)Skipt User rank is General 5th Grade (Above 100000 Reputation Level)Skipt User rank is General 5th Grade (Above 100000 Reputation Level)  Folding Points: 84 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 3 h 11 m 44 sec
Reputation Power: 1287
Send a message via AIM to Skipt
Facebook
Quote:
(i.e., just with HTML code)?

No
__________________
"Quality of responses may vary. I reserve the right to change my mind for any reason what-so-ever without admitting I was wrong. I'd prefer to change your mind however, it's easier on my ego". - jwdonahue

Reply With Quote
  #6  
Old June 7th, 2009, 12:52 PM
Kathy Sutton Kathy Sutton is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 25 Kathy Sutton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 15 m 2 sec
Reputation Power: 0
I am looking at JavaScript and PHP options to enable this functionality. I have novice question on using PHP. Would I have to convert my First page to .php or would converting the Second page alone to .php suffice?

(Converting the first page to .PHP will be complicated since it is receiving lilnks from other sites.)

I am attaching my original question for convenience ....

I have a question of how I can transfer data entered by users on one web page to another.

I have two fields on a web page First Name and E-Mail Address that users populate. When they hit the submit button, they are directed to a more detailed form where the users enter data in several fields in addition to First Name and E-Mail address. I am trying to make this page user friendly so that users do not have to re-enter their First Name and E-Mail Address. How can I get the First Name and E-Mail Address fields to auto-populate in the second form page? Can this be done using HTML?

Reply With Quote
  #7  
Old June 7th, 2009, 01:45 PM
Winters Winters is offline
Bad Coder
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,846 Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 15 h 41 m 16 sec
Reputation Power: 1597
It can be quite easily performed by Javascript, however, you must allow for users who have Javascript disabled. A server-side handling script would be the best choice.
Comments on this post
holodoc agrees!
__________________
[PHP] | [Perl] | [Python] | [Java] | [Javascript] | [XML] | [ANSI C] | [C++] | [MySQL] | [FirebirdSQL] | [PostgreSQL] | [HTML] | [XHTML] | [CSS]

If it wasn't for C, we'd be using BASI, PASAL and OBOL.

Reply With Quote
  #8  
Old June 7th, 2009, 02:29 PM
Kathy Sutton Kathy Sutton is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 25 Kathy Sutton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 15 m 2 sec
Reputation Power: 0
With PHP, will it suffice if I rename my Second more-detailed data capture page .PHP? Or do I have to introduce PHP code into the First simpe data capture page as well.

I will appreciate if someone can put a link to a good tutorial link (or guidance) on the PHP-based approach.

Reply With Quote
  #9  
Old June 7th, 2009, 02:35 PM
Winters Winters is offline
Bad Coder
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,846 Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 15 h 41 m 16 sec
Reputation Power: 1597
Do you have any experience scripting or programming?

Reply With Quote
  #10  
Old June 7th, 2009, 03:15 PM
Kathy Sutton Kathy Sutton is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 25 Kathy Sutton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 15 m 2 sec
Reputation Power: 0
My knowledge is limited; I am getting started. Hence the request for help.

Reply With Quote
  #11  
Old June 7th, 2009, 03:53 PM
Winters Winters is offline
Bad Coder
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,846 Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level)Winters User rank is General 9th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 15 h 41 m 16 sec
Reputation Power: 1597
Quote:
Hence the request for help.
Yes, I gathered, which is why I asked, to better know the level of help you need.

Does your server have PHP, Perl, ASP, etc installed?

Reply With Quote
  #12  
Old June 7th, 2009, 03:58 PM
Kathy Sutton Kathy Sutton is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 25 Kathy Sutton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 15 m 2 sec
Reputation Power: 0
Quote:
Originally Posted by Winters
Yes, I gathered, which is why I asked, to better know the level of help you need.

Does your server have PHP, Perl, ASP, etc installed?


THansk. My server supports PHP. It does not support Perl or ASP.

Reply With Quote
  #13  
Old June 7th, 2009, 04:07 PM
holodoc's Avatar
holodoc holodoc is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2004
Location: Kostolac, Serbia
Posts: 663 holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 15 h 59 m 52 sec
Reputation Power: 980
Send a message via Google Talk to holodoc Send a message via Skype to holodoc
Since its most likely that the server is PHP enabled here is a very basic PHP script that can achieve what you want.

service-step-one.php
Code:
<!-- Your first page form -->
<form method="post" action="service-step-two.php">
	<p>
	<label for="firstName">First name:</label>
	<input id="firstName" name="firstName" type="text" maxlength="30" />
	<label for="email">Email:</label>
	<input id="email" name="email" type="text" type="text" maxlength="100" />
	</p>
	<p>
	<input id="submitButton" type="submit" value="Next >>" />
	</p>
</form>

service-step-two.php
PHP Code:
<?php
/*
* This goes right at the very beginning of your second page.
*/
if(!isset($_POST['firstName']) || !isset($_POST['email'])){
    
header('Location: service-step-one.php');
    exit();
}
?>
<!-- This is somewhere in your HTMl where you want your populated form to appear. -->
<form method="post" action="service-step-three.php">
    <form method="post" action="service-step-two.php">
    <p>
    <label for="firstName">First name:</label>
    <input id="firstName" name="firstName" type="text" maxlength="30" value="<?php echo $_POST['firstName']; ?>" />
    <label for="email">Email:</label>
    <input id="email" name="email" type="text" type="text" maxlength="100" value="<?php echo $_POST['email']; ?>" />
    Here goes the rest of the details....
    </p>
    <p>
    <input id="submitButton" type="submit" value="Next >>" />
    </p>
</form>
You should first confront your user with the service-step-two.php page where he fill sin his name and email. If he however just submits the form without filling it he will be redirected again to the first form. Note however that this is just a very basic example of how you would do it and that there are potential security risks etc. possibly involved in this code.

For further reading you could try:
http://www.w3schools.com/php/php_forms.asp
http://www.w3schools.com/php/php_post.asp

Now Winters is going to kill me for ruining his joy

Last edited by holodoc : June 7th, 2009 at 04:15 PM.

Reply With Quote
  #14  
Old June 7th, 2009, 05:49 PM
Kathy Sutton Kathy Sutton is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 25 Kathy Sutton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 15 m 2 sec
Reputation Power: 0
Thanks for your reply and detailed help with the code. I will study it. From the look of it, it appears my first page will have to be converted from a HTML extension to a PHP extension. Am I correct? If so, it is a problem for me since the first page is receiving several links from other websites. I am required to keep the first page a HTML. Is there any way around this?

Reply With Quote
  #15  
Old June 7th, 2009, 06:24 PM
holodoc's Avatar
holodoc holodoc is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2004
Location: Kostolac, Serbia
Posts: 663 holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level)holodoc User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 15 h 59 m 52 sec
Reputation Power: 980
Send a message via Google Talk to holodoc Send a message via Skype to holodoc
Quote:
Originally Posted by Kathy Sutton
Thanks for your reply and detailed help with the code. I will study it. From the look of it, it appears my first page will have to be converted from a HTML extension to a PHP extension. Am I correct? If so, it is a problem for me since the first page is receiving several links from other websites. I am required to keep the first page a HTML. Is there any way around this?
In this case your first page (service-step-one.php) doesn't have to be a PHP page since it doesn't contain any PHP code. Only pages that contain PHP code delimited by PHP tags (<?php ... ?>) need to have a .php extension.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Pre-filling HTML forms


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek