|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
Possible with PHP.
|
|
#3
|
|||
|
|||
|
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)?
|
|
#4
|
||||
|
||||
|
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:
|
|
#5
|
||||
|
||||
|
Quote:
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 |
|
#6
|
|||
|
|||
|
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? |
|
#7
|
|||
|
|||
|
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.
__________________
[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. |
|
#8
|
|||
|
|||
|
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. |
|
#9
|
|||
|
|||
|
Do you have any experience scripting or programming?
|
|
#10
|
|||
|
|||
|
My knowledge is limited; I am getting started. Hence the request for help.
|
|
#11
|
|||
|
|||
|
Quote:
Does your server have PHP, Perl, ASP, etc installed? |
|
#12
|
|||
|
|||
|
Quote:
THansk. My server supports PHP. It does not support Perl or ASP. |
|
#13
|
||||
|
||||
|
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:
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. |
|
#14
|
|||
|
|||
|
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?
|
|
#15
|
||||
|
||||
|
Quote:
|
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Pre-filling HTML forms |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|