Hi All,

I am trying to find out how to pass the results of a script in one form to an input box(s) in second form. I don't even know if this can be done? I have attached the code below - The first form (zip_lookup)gets postcode data and calculates the distance between them and writes the result with a little bit of math. The second form posts data to formmail.cgi. What I want to do is when the user enters the postcodes and clicks 'calculate costs' for the document to write as normal and enter the data into the three input boxes of the second form (contact).

Hope someone can help.

Colin Smith.

The code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<div id="container">
<div id="content">
<script language="javascript" type="text/javascript" src="http://www.pc-i.co.uk/postcode_js.php">
<form name="zip_lookup" id="zip_lookup" method="get">
<p class="small">
<table width="100%" border="0" cellpadding="0" cellspacing="10">
<td valign="top" class="small">Collection Postcode:</td>
<td valign="top" class="small"><input type="text" name="post_a" id="post_a" /></td>
<td valign="top" class="small">Delivery Postcode:</td>
<td valign="top" class="small"><input type="text" name="post_b" id="post_b" /></td>
<td valign="top" class="small"><input name="submit" type="submit" value="Calculate cost" /></td>
<td valign="top" class="small">
<script language="javascript" type="text/javascript">
var _start= Math.round (miles*100)/100;
var _end1= Math.round (_start*120)/100;
var _saving= Math.round ((_end1-_start)*100)/100;
if(postcode_a != "")
if (miles < 10) {document.write("The cost of your consignment is <b>&pound;12.00</b> We will contact you to confirm this."); }
{document.write("The cost of your consignment is <b>&pound;"+_end1+"</b> Sameday or Overnight service, or" + "<br />"); }
if (miles < 10) {document.write("" ); }
{document.write("<b>&pound;"+_start+"</b> Non priority service, saving you <b>&pound;"+_saving+"</b>. We will contact you to confirm this."); }
<form action="/formmail/FormMail.cgi" method="post" name="contact" class="" id="contact">
<table width="100%" border="0" cellpadding="0" cellspacing="10">
<td valign="top" class="small">

<input name="Delivery service" type="radio" value="Same Day" />
<input name="Same Day cost" type="text" id="Same Day cost" size="10" />
Same Day delivery anywhere in the UK. <br />
<br />
<input name="Delivery service" type="radio" value="Overnight" />
<input name="Overnight cost" type="text" id="Overnight cost"size="10" />
Overnight delivery &amp; collection.<br />
<br />
<input name="Delivery service" type="radio" value="Non priority" />
<input name="Non priority cost" type="text" id="Non priority cost"size="10" />
Non Priority delivery &amp; collection.<br />
<br />
<input name="Submit" type="Submit" value="Confirm booking" />