A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Murach's Java Servlets and JSP
this week in the
Prepopulate a form field with data entered on a previous page
Joined: Aug 03, 2011
Aug 03, 2011 10:05:05
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.
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
subject: Prepopulate a form field with data entered on a previous page
Fetching information from database in jsp
How to position fieldset?
form in multilingual
JSP <a href> tags breaks page functionality
Regarding HTML Form
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014