Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing form values from one form to another? I have to click inside

Status
Not open for further replies.

albnuts

Instructor
Aug 20, 2000
1
US
You can view this by going to
I have 4 forms. Each form has three text fields that are set up to pass info to the next form by just clicking inside the text box. The information if remembered, but I would like to have it work with not having to click inside the box. I would like to have it to go to form2.htm and have the info already inside the box..Do you have any suggestions?

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<script language=&quot;JavaScript&quot;>

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! -->

<!-- Begin
function getCookie(name){
var cname = name + &quot;=&quot;;
var dc = document.cookie;
if (dc.length > 0) {
begin = dc.indexOf(cname);
if (begin != -1) {
begin += cname.length;
end = dc.indexOf(&quot;;&quot;, begin);
if (end == -1) end = dc.length;
return unescape(dc.substring(begin, end));
}
}
return null;
}
function setCookie(name, value) {
var now = new Date();
var then = new Date(now.getTime() + 31536000000);
document.cookie = name + &quot;=&quot; + escape(value) + &quot;; expires=&quot; + then.toGMTString() + &quot;; path=/&quot;;
}
function getInfo(form) {
form.info.value = &quot;Browser Information: &quot; + navigator.userAgent;
}
function getValue(element) {
var value = getCookie(element.name);
if (value != null) element.value = value;
}
function setValue(element) {
setCookie(element.name, element.value);
}
function fixElement(element, message) {
alert(message);
element.focus();
}
function isMailReady(form) {
var passed = false;
if (form.fullname.value == &quot;&quot;) {
fixElement(form.fullname, &quot;Please include your name.&quot;);
}
else if (form.email.value.indexOf(&quot;@&quot;) == -1 ||
form.email.value.indexOf(&quot;.&quot;) == -1) {
fixElement(form.email, &quot;Please include a proper email address.&quot;);
}
else if (form.message.value == &quot;&quot;) {
fixElement(form.message, &quot;Please include a message.&quot;);
}
else {
getInfo(form);
passed = true;
}
return passed;
}
// End -->
</script>

<body bgcolor=&quot;#CCFFFF&quot;>
<form METHOD=&quot;POST&quot; ACTION=&quot; TARGET=&quot;_parent&quot;>

<p>
<input type=&quot;hidden&quot; name=&quot;recipient&quot; value=&quot;albnuts@netwiz.net&quot; onSubmit = &quot;return isMailReady(this);&quot;>
</p>
<p><a href=&quot;form1.htm&quot;>Form1.htm</a><br>
<a href=&quot;form2.htm&quot;>Form2.htm</a><br>
<a href=&quot;form3.htm&quot;>Form3.htm</a><br>
<a href=&quot;form4.htm&quot;>Form4.htm </a> </p>
<p align=&quot;left&quot;><b><font size=&quot;5&quot;>Shipping Information</font></b> (form1)<br>
Shipping Infomation ~ <b>IMPORT~<br>
</b></p>
<table width=&quot;100%&quot; border=&quot;1&quot; cellpadding=&quot;3&quot;>

<tr>

</tr>

<td width=&quot;27%&quot;><b><font color=&quot;#FF0033&quot;>Customer ID:</font></b></td>
<td width=&quot;73%&quot;>
<input type = &quot;TEXT&quot; name = &quot;cutomerID&quot; onFocus = &quot;getValue(this)&quot; onBlur = &quot;setValue(this)&quot; maxlength=&quot;60&quot;>
</td>
</tr>
<tr>
<td height=&quot;31&quot; width=&quot;27%&quot;><b><font color=&quot;#FF0033&quot;>PO # (KBS Confirmation
#) </font></b></td>
<td height=&quot;31&quot; width=&quot;73%&quot;>
<input type = &quot;TEXT&quot; name = &quot;KBS confirmation number&quot; onFocus = &quot;getValue(this)&quot; onBlur = &quot;setValue(this)&quot;>
</td>
</tr>
<tr>
<td width=&quot;27%&quot;><b><font color=&quot;#FF0033&quot;>Customer PO #:</font></b></td>
<td width=&quot;73%&quot;>
<input type=&quot;text&quot; name=&quot;Customer PO number&quot; onFocus = &quot;getValue(this)&quot; onBlur = &quot;setValue(this)&quot; maxlength=&quot;60&quot;>
</td>
</tr>
<tr>
<td width=&quot;27%&quot;><b>Ship Date:</b></td>
<td width=&quot;73%&quot;>
<input type=&quot;text&quot; name=&quot;ship date&quot; size=&quot;50&quot; maxlength=&quot;200&quot;>
</td>
</tr>
<tr>
<td width=&quot;27%&quot; height=&quot;22&quot;><b>Vessel:</b></td>
<td width=&quot;73%&quot; height=&quot;22&quot;>
<input type=&quot;text&quot; name=&quot;vessel&quot; size=&quot;50&quot; maxlength=&quot;200&quot;>
</td>
</tr>
<tr>
<td width=&quot;27%&quot;><b>Port of Loading:</b></td>
<td width=&quot;73%&quot;>
<input type=&quot;text&quot; name=&quot;port of loading&quot; size=&quot;50&quot; maxlength=&quot;200&quot;>
</td>
</tr>
<tr>
<td width=&quot;27%&quot;><b>Port of Discharge:</b></td>
<td width=&quot;73%&quot;>
<input type=&quot;text&quot; name=&quot;port of discharge&quot; size=&quot;50&quot; maxlength=&quot;200&quot;>
</td>
</tr>
<tr>
<td width=&quot;27%&quot;><b>Port of Destination:</b></td>
<td width=&quot;73%&quot;>
<input type=&quot;text&quot; name=&quot;port of destination&quot; size=&quot;50&quot; maxlength=&quot;200&quot;>
</td>
</tr>
<tr>
<td width=&quot;27%&quot;><b>Cargo Receipt:</b></td>
<td width=&quot;73%&quot;>
<input type=&quot;text&quot; name=&quot;cargo receipt&quot; size=&quot;50&quot; maxlength=&quot;200&quot;>
</td>
</tr>
<tr>
<td width=&quot;27%&quot; height=&quot;35&quot;><b>Container #</b></td>
<td width=&quot;73%&quot; height=&quot;35&quot;>
<input type=&quot;text&quot; name=&quot;Container&quot; size=&quot;50&quot; maxlength=&quot;200&quot;>
</td>
</tr>
<tr>
<td width=&quot;27%&quot;><b>Description:</b></td>
<td width=&quot;73%&quot;>
<input type=&quot;text&quot; name=&quot;description&quot; size=&quot;50&quot; maxlength=&quot;200&quot;>
</td>
</tr>
<tr>
<td width=&quot;27%&quot;><b>Carton Weight:</b></td>
<td width=&quot;73%&quot;>
<input type=&quot;text&quot; name=&quot;carton weigtht&quot; size=&quot;50&quot; maxlength=&quot;200&quot;>
</td>
</tr>
<tr>
<td width=&quot;27%&quot;><b>Cargo Fowarder:</b></td>
<td width=&quot;73%&quot;>
<input type=&quot;text&quot; name=&quot;cargo fowarder&quot; size=&quot;50&quot; maxlength=&quot;200&quot;>
</td>
</tr>
<tr bgcolor=&quot;#9999FF&quot;>
<td colspan=&quot;2&quot;>&nbsp;</td>
</tr>
<tr>
<td colspan=&quot;2&quot;>
<div align=&quot;center&quot;>
<table width=&quot;35%&quot; border=&quot;1&quot; cellpadding=&quot;`&quot;>
<tr bgcolor=&quot;#000000&quot;>
<td>
<div align=&quot;center&quot;><font color=&quot;#FFFFFF&quot;><b><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;>KBSAPPAREL.COM
HOME<br>
RETURN TO NOTEBOOK</font></b></font></div>
</td>
</tr>
</table>
<p>
<input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot;>
<input type=&quot;reset&quot; name=&quot;Submit2&quot; value=&quot;Reset&quot;>
</p>
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
 
Two men get on a train going south at 50 mph and travel for 7 minutes then changes seats. Then three women get on the train and sit on both sides of each man. One women is wearing a hat, one is a read head and the third is a night clerk at the AMPM on 42nd avenue. 6 miles later both men get off the train. The first man buys the second mans watch for 10 dollars and gives him a 20 dollar bill to purchase it. How much change does he get?

What the heck does all that other junk have to do with the problem or the question, it's just getting in the way, get rid of it when you post a question.

&quot;But, that's just my opinion... I could be wrong&quot;.
-pete

 
Hi, -pete

You are wrong. All &quot;that other junk&quot; is useful info. I wish other questions gave that much detail. What seems a waste of space is your story. I hope someone can answer the question intelligently.

Helmut
 
> You are wrong.

I see, well I could perform the work myself to reduce the amount of code to the minumum required to produce the behavior described in the original post in order to prove my point. However I don't feel I should have to, it's a fairly simple concept, so I'm not going to. You go right on believing what you want. But thanks for your input just the same.

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top