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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automatically filling in text field in forms ...

Status
Not open for further replies.

Sibylle

Technical User
Jul 2, 2001
13
US
I created an order form for our website:
but my boss wants me to make it as easy as possible for our visitors, by modifying the form so that it will automatically fill in the "product description", after a webvisitor filled in the "catalog number." I have gone through thousands of scripts, but didn't find anything that would help with with that. Can anyone help?

Sibylle Faye
 
Are you familiar with arrays? What is your programming level in javascript?

If you have only a small amount of items make the catalog number a pull-down select box and then using the selectedIndex you can fish out information for the item description.

Hope this helps. Gary Haran
 
okie..well heres mine. this works, as im Sure xutopia's will :).
heres your full code:
Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<script language=&quot;javascript&quot;><!--
function getDescription(catnum,num)
{
var descriptions = new Array();
descriptions[1] = 'description for catalog num here';
descriptions[2] = 'description for catalog num 2 here';
descriptions[40967] = 'description for catalog num 40967 here';
// etc...
var thefield = eval(&quot;document.OrderingForm.description&quot;+num);
thefield.value = descriptions[catnum]; // assigns the textarea the value of the description number in the array
}
//--></script>
</head>

<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;>
<p align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; color=&quot;#66CC33&quot;><font size=&quot;2&quot; color=&quot;#330099&quot;><b><a name=&quot;Ordering&quot;></a><font color=&quot;#008000&quot; size=&quot;3&quot;>Ordering 
  Form &amp; Procedures: </font></b></font></font></p>
<p align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#330099&quot;><img src=&quot;images/bar.gif&quot; width=&quot;276&quot; height=&quot;5&quot;></font></p>
<p align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#330099&quot;>For 
  more information, please visit our <a href=&quot;customersupport.htm&quot;>Customer Support</a> 
  page. <br>
  </font></p>
<p align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; color=&quot;#66CC33&quot;><font size=&quot;2&quot; color=&quot;#330099&quot;>To 
  place an order, please fill in the form below and submit electronically, or 
  <br>
  fill in the form, print and fax back to (858) 558-7166, together with your signed 
  Purchase Order:</font></font></p>
<form name=&quot;OrderingForm&quot; method=&quot;post&quot; action=&quot;/cgi-sys/formmail.pl&quot;>
  <input type=hidden name=&quot;recipient&quot; value=&quot;info@chromagen.com&quot;>
  <table width=&quot;100%&quot; border=&quot;0&quot;>
    <tr bgcolor=&quot;#250499&quot;> 
      <td colspan=&quot;3&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b><font color=&quot;#FFFFFF&quot;>Purchase 
        Order Info</font></b></font></td>
    </tr>
    <tr> 
      <td rowspan=&quot;2&quot; width=&quot;10%&quot;>&nbsp;</td>
      <td width=&quot;20%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>P.O. 
        Number</b></font> </td>
      <td width=&quot;70%&quot;> 
        <input type=&quot;text&quot; name=&quot;Purchase Order&quot;>
      </td>
    </tr>
    <tr> 
      <td width=&quot;20%&quot;> 
        <p><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Order 
          Date</b></font> </p>
      </td>
      <td width=&quot;82%&quot; height=&quot;28&quot;> 
        <input type=&quot;text&quot; name=&quot;Order Date&quot;>
      </td>
    </tr>
  </table>
  <table width=&quot;100%&quot; border=&quot;0&quot;>
    <tr bgcolor=&quot;#250499&quot;> 
      <td colspan=&quot;6&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b><font color=&quot;#FFFFFF&quot;>Billing 
        Address</font></b></font></td>
    </tr>
    <tr> 
      <td rowspan=&quot;10&quot; width=&quot;10%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;></font><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;></font><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;></font><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;></font></td>
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Name 
        </b></font></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Billing Name&quot; value=&quot;&quot; size=&quot;50&quot;>
        </b></font></td>
    </tr>
    <tr> 
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Tel. 
        No.</b></font></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Billing Telephone No.&quot; size=&quot;50&quot;>
        </b></font><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;></font></td>
    </tr>
    <tr>
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Fax. 
        No.</b></font></td>
      <td width=&quot;70%&quot;>
        <input type=&quot;text&quot; name=&quot;textfield&quot; size=&quot;50&quot;>
      </td>
    </tr>
    <tr> 
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Company 
        or Institution </b></font></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Billing Company&quot; value=&quot;&quot; size=&quot;50&quot;>
        </b></font></td>
    </tr>
    <tr> 
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Dept. 
        </b></font></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Billing Dept.&quot; size=&quot;50&quot;>
        </b></font></td>
    </tr>
    <tr> 
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Street 
        </b></font></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Billing Street&quot; size=&quot;50&quot;>
        </b></font></td>
    </tr>
    <tr> 
      <td colspan=&quot;4&quot;><b><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;>City</font></b></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Billing City&quot; size=&quot;50&quot;>
        </b></font></td>
    </tr>
    <tr> 
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>State</b></font></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Billing State&quot; size=&quot;50&quot;>
        </b></font></td>
    </tr>
    <tr> 
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Zip 
        Code</b></font></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Billing Zip&quot; size=&quot;50&quot;>
        </b></font></td>
    </tr>
    <tr> 
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Country</b></font></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Billing Country&quot; size=&quot;50&quot;>
        </b></font></td>
    </tr>
  </table>
  <table width=&quot;100%&quot; border=&quot;0&quot;>
    <tr bgcolor=&quot;#250499&quot;> 
      <td colspan=&quot;6&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b><font color=&quot;#FFFFFF&quot;>Shipping 
        Address (Please fill in only if different from billing address)</font></b></font></td>
    </tr>
    <tr> 
      <td rowspan=&quot;10&quot; width=&quot;10%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;></font><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;></font><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;></font><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;></font></td>
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Name 
        </b></font></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Shipping Name&quot; size=&quot;50&quot;>
        </b></font></td>
    </tr>
    <tr> 
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Tel. 
        No.</b></font></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Shipping Telephone No.&quot; size=&quot;50&quot;>
        </b></font><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;></font></td>
    </tr>
    <tr>
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Fax 
        No.</b></font></td>
      <td width=&quot;70%&quot;>
        <input type=&quot;text&quot; name=&quot;textfield2&quot; size=&quot;50&quot;>
      </td>
    </tr>
    <tr> 
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Company 
        or Institution </b></font></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Shipping Company&quot; size=&quot;50&quot;>
        </b></font></td>
    </tr>
    <tr> 
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Dept. 
        </b></font></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Shipping Dept.&quot; size=&quot;50&quot;>
        </b></font></td>
    </tr>
    <tr> 
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Street 
        </b></font></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Shipping Street&quot; size=&quot;50&quot;>
        </b></font></td>
    </tr>
    <tr> 
      <td colspan=&quot;4&quot;><b><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;>City</font></b></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Shipping City&quot; size=&quot;50&quot;>
        </b></font></td>
    </tr>
    <tr> 
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>State</b></font></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Shipping State&quot; size=&quot;50&quot;>
        </b></font></td>
    </tr>
    <tr> 
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Zip 
        Code</b></font></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Shipping Zip&quot; size=&quot;50&quot;>
        </b></font></td>
    </tr>
    <tr> 
      <td colspan=&quot;4&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Country</b></font></td>
      <td width=&quot;70%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b> 
        <input type=&quot;text&quot; name=&quot;Shipping Country&quot; size=&quot;50&quot;>
        </b></font></td>
    </tr>
  </table>
  <table width=&quot;100%&quot; border=&quot;0&quot;>
    <tr bgcolor=&quot;#250499&quot;> 
      <td colspan=&quot;3&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b><font color=&quot;#FFFFFF&quot;>Product 
        Information</font></b></font></td>
    </tr>
    <tr> 
      <td colspan=&quot;3&quot;>&nbsp;</td>
    </tr>
    <tr> 
      <td width=&quot;14%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Quantity</b></font></td>
      <td width=&quot;19%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Catalog 
        Number </b></font></td>
      <td width=&quot;67%&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Item 
        Description</b></font></td>
    </tr>
    <tr> 
      <td width=&quot;14%&quot; valign=&quot;top&quot;> 
        <input type=&quot;text&quot; name=&quot;Quantity1&quot; maxlength=&quot;4&quot; size=&quot;10&quot;>
      </td>
      <td width=&quot;19%&quot; valign=&quot;top&quot;> 
        <input type=&quot;text&quot; name=&quot;Catalog No&quot; maxlength=&quot;7&quot; onBlur=&quot;getDescription(this.value,'1')&quot;>
      <td width=&quot;67%&quot; valign=&quot;top&quot;> 
        <textarea name=&quot;description1&quot; cols=&quot;50&quot;></textarea>
      </td>
    </tr>
  </table>  
  <table width=&quot;100%&quot; border=&quot;0&quot;>
    <tr> 
      <td width=&quot;14%&quot; valign=&quot;top&quot;> 
        <input type=&quot;text&quot; name=&quot;Quantity2&quot; maxlength=&quot;4&quot; size=&quot;10&quot;>
      </td>
      <td width=&quot;19%&quot; valign=&quot;top&quot;> 
        <input type=&quot;text&quot; name=&quot;Catalog No.2&quot; maxlength=&quot;7&quot; onBlur=&quot;getDescription(this.value,'2')&quot;>
      </td>
      <td width=&quot;67%&quot; valign=&quot;top&quot;> 
        <textarea name=&quot;description2&quot; cols=&quot;50&quot;></textarea>
      </td>
    </tr>
  </table>
  <table width=&quot;100%&quot; border=&quot;0&quot;>
    <tr> 
      <td width=&quot;14%&quot; valign=&quot;top&quot;> 
        <input type=&quot;text&quot; name=&quot;Quantity3&quot; maxlength=&quot;4&quot; size=&quot;10&quot;>
      </td>
      <td width=&quot;19%&quot; valign=&quot;top&quot;> 
        <input type=&quot;text&quot; name=&quot;Catalog No.3&quot; maxlength=&quot;7&quot; onBlur=&quot;getDescription(this.value,'3')&quot;>
      </td>
      <td width=&quot;67%&quot; valign=&quot;top&quot;> 
        <textarea name=&quot;description3&quot; cols=&quot;50&quot;></textarea>
      </td>
    </tr>
  </table>
  <table width=&quot;100%&quot; border=&quot;0&quot;>
    <tr> 
      <td width=&quot;14%&quot; valign=&quot;top&quot;> 
        <input type=&quot;text&quot; name=&quot;Quantity4&quot; maxlength=&quot;4&quot; size=&quot;10&quot;>
      </td>
      <td width=&quot;19%&quot; valign=&quot;top&quot;> 
        <input type=&quot;text&quot; name=&quot;Catalog No.4&quot; maxlength=&quot;7&quot; onBlur=&quot;getDescription(this.value,'4')&quot;>
      </td>
      <td width=&quot;67%&quot; valign=&quot;top&quot;> 
        <textarea name=&quot;description4&quot; cols=&quot;50&quot; wrap=&quot;OFF&quot;></textarea>
      </td>
    </tr>
  </table>
  <table width=&quot;100%&quot; border=&quot;0&quot;>
    <tr> 
      <td colspan=&quot;3&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Special 
        Instructions / Comments</b></font></td>
    </tr>
    <tr> 
      <td colspan=&quot;2&quot;> 
        <textarea name=&quot;textarea3&quot; cols=&quot;50&quot;></textarea>
      </td>
      <td width=&quot;65%&quot;> 
        <input type=&quot;submit&quot; name=&quot;Submit22&quot; value=&quot;Submit&quot;>
      </td>
    </tr>
  </table>
  </form>
<p align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; color=&quot;#66CC33&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#330099&quot;><b>Chromagen 
  accepts orders via phone, fax and mail. </b></font><font size=&quot;2&quot; color=&quot;#330099&quot;><br>
  Toll-free: 1(888) 724-7662 </font><font face=&quot;Arial, Helvetica, sans-serif&quot; color=&quot;#330099&quot; size=&quot;2&quot;><b><img src=&quot;images/bullet3.gif&quot; width=&quot;7&quot; height=&quot;7&quot;></b></font><font size=&quot;2&quot; color=&quot;#330099&quot;> 
  Fax: (858) 558-7166 </font></font><font face=&quot;Arial, Helvetica, sans-serif&quot; color=&quot;#330099&quot; size=&quot;2&quot;><b><img src=&quot;images/bullet3.gif&quot; width=&quot;7&quot; height=&quot;7&quot;></b> 
  e-mail orders: <a href=&quot;mailto:sales@chromagen.com&quot;>sales@chromagen.com</a><br>
  Mail Orders: Chromagen, Inc., 10449 Roselle Street, San Diego, CA 92121-1503</font></p>
<p align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#330099&quot;><img src=&quot;images/bar.gif&quot; width=&quot;276&quot; height=&quot;5&quot;></font></p>
<p><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#330099&quot;><b><a name=&quot;pricing&quot;></a>Pricing 
  / Terms:</b> All prices are in U.S. Dollars. Prices are subject to change without 
  notice. Please inquire about volume discounts. Payment terms are net 30 days. 
  Please pay in US Dollars with checks drawn on a US bank account, or via wire 
  transfer.</font></p>
<p align=&quot;left&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#330099&quot;><b><a name=&quot;volume&quot;></a>Large 
  Volume Orders: </b>Most of our products are available in quantities designed 
  for High Throughput Screening (HTS). Please contact our <a href=&quot;mailto:info@chromagen.com&quot;>Marketing 
  Department</a> for a price quotation on the quantity desired.</font></p>
<p align=&quot;left&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#330099&quot;><b>Standing 
  Orders: </b>Periodic shipments on large purchase orders or frequently purchased 
  items are offered as a service to our customers. Please contact the <a href=&quot;mailto:info@chromagen.com&quot;>Customer 
  Service Department</a> to arrange a delivery schedule. </font></p>
<p align=&quot;left&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#250499&quot;><b>Return 
  / Refund Policy:</b> Customer satisfaction is our top priority, and we will 
  do our best to resolve any issues that may incur. At our discretion, we may 
  issue a product credit or refund for the product value and shipping charges, 
  if the product is proven to be defective or we shipped you an item that you 
  did not order. Please contact <a href=&quot;mailto:info@chromagen.com&quot;>Customer Service</a> 
  at (888) 724-7662 with any concerns that you may have.</font></p>
</body>
</html>
i changed the form name and some textarea/texbox names..make it a little easier for me to reference them :-D

hope it helps Suceess, thats the way you spell success!
Got a question? Ask IMOZRMY!
 
Once again Dookie2k2 gets there before me! :) I like you solution Dookie2k2 but an object based solution would seem to be the best one in my opinion.

Take a look at this and let me know if I made any mistakes. Objects are great in the sense that they allow you to have a holder for all kinds of things.

var catalogItems = new Array()

function catalogItem(num, name, desc)
{
this.id = catalogItems.length

this.num = num
this.name = name
this.desc = desc

catalogItems[catalogItems.length] = this
}

// create your items here :
catalogItem(3245, &quot;blubber machine&quot;, &quot;creates blubber on demand&quot;)
catalogItem(9842, &quot;flubber machine&quot;, &quot;creates flubber on demand&quot;)
catalogItem(5025, &quot;stubber machine&quot;, &quot;creates stubber on demand&quot;)
catalogItem(3642, &quot;clubber machine&quot;, &quot;creates clubber on demand&quot;)
// stop creating items here


function selectItemFiller(formSelect)
{
for (var i = 0; i < catalogItems.length; i++)
{
formSelect.options[formSelect.options.length] = new Option(catalogItems.desc, i)
}
}

function fillAllSelects()
{
// next array is the selects you want the user to
// choose the product number from
var arrayOfSelect = [ document.formName.formSelectName1,
document.formName.formSelectName2,
document.formName.formSelectName3 ]

for (var i = 0; i < arrayOfSelect.length; i++)
{
selectItemFiller(arrayOfSelect)
}
}

function fillFormDesc(formSelectItem, formDescElement)
{
formDescElement.value = catalogItems[formSelectItem.selecteIndex]
}

on the selectItem in your form you simply have to say :

<select onchange=&quot;fillFormDesc(this, document.formName.formDescNumber)&quot;>

I think that should work. You will have to figure out a few things here. Let me know how it works. Gary Haran
 
I really appreciate your help. You guys are amazing. Thanks!

Sibylle Faye (who was tearing her hair out over this for weeks!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top