Register / Login
this forum made possible by our volunteer staff, including ...
Stephan van Hulst
Prepopulate a form field with data entered on a previous page
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Help. I am totally lost. I'm trying to put together a website for a friend, and the last programming class I took was Fortran, so forgive me if I don't know proper terminology.
In the footer of my index page,
, I have a box where a person can input an email address to sign up to receive a company e-newsletter. When you hit "GO" it takes you to the Newsletter Signup page.
<form action="newslettersignup.html" method="post">
<input type="text" name="email" value="Enter Email Here…" onfocus="this.value=(this.value=='Enter Email Here…')? '' : this.value ;" />
<input type="submit" name="news_go" id="news_go" value="GO" />
When you get to the Newsletter Signup page,
, I want the form to pre-populate the Your Email field with the email that the user previously entered in the footer of the index page. Here's the code for my form:
<form method="post" action="sendmail.php">
<label for="email">Your Email:
<input id="email" name="email" type="text" size="50">
<label for="firstname">First Name:
<input id="firstname" name="firstname" type="text" size="50">
<label for="lastname">Last Name:
<input id="lastname" name="lastname" type="text" size="50">
<input id="company" name="company" type="text" size="50">
<input id="position" name="position" type="text" size="50">
<label class="submit" for="submit">
<input id="submit" type="submit" value="Submit">
I know I need to pass some variable, but I have no idea how to modify the code to do so, and I can't find explicit help on the web. Thanks for any help you can provide.
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
Thread Boost feature
Boost this thread!
JSP <a href> tags breaks page functionality
Fetching information from database in jsp
How to position fieldset?
form in multilingual
Regarding HTML Form