• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

dymanic form input from choosen selection

Guest
Nov 16, 2009 Nov 16, 2009

Copy link to clipboard

Copied

I've got to fields on called supplier and the second one called product.

Both fileds can be populated form the database.

However. If the first field is selected ( Supplier) how

can i have the secon field ( product) automatically populated with only

those products applicable form the choosen supplier.

And the other way around.

The script i'm having is below.

<cfquery name="rs_supplier" datasource="Reach">
SELECT distinct "Supplier"
         FROM ProdSupplier
   ORDER BY Supplier ASC
</cfquery>
<cfquery name="rs_ProdFam" datasource="Reach">
SELECT distinct "ProdFam"
         FROM ProdSupplier
ORDER BY ProdFam ASC
</cfquery>

<html>
<head>


-->
</style></head>

<body>
<form name="form1" method="post" action="report1.cfm?">
  <p> </p>
  <table width="89%"  border="0">
    <tr>
      <td height="29"> </td>
      <td><span class="style1">REACH Documents </span></td>
      <td> </td>
    </tr>
    <tr>
      <td height="29"> </td>
      <td> </td>
      <td> </td>
    </tr>
    <tr>
      <td height="29">Supplier</td>
      <td><select name="Supplier" size="1" >
        <cfoutput query="rs_supplier">
          <option value="#rs_supplier.Supplier#"> #rs_supplier.Supplier#</option>
        </cfoutput>
      </select></td>
      <td> </td>
    </tr>
    <tr>
      <td height="29">Product Family </td>
      <td><select name="ProdFam" size="1" id="ProdFam" >
        <cfoutput query="rs_ProdFam">
            <option value="#rs_ProdFam.ProdFam#"> #rs_ProdFam.ProdFam#</option>
        </cfoutput>
      </select></td>
      <td> </td>
    </tr>
    <tr>
      <td height="29"> </td>
      <td> </td>
      <td> </td>
    </tr>
    <tr>

TOPICS
Advanced techniques

Views

304

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 16, 2009 Nov 16, 2009

Copy link to clipboard

Copied

LATEST

What you are attempting is often called related selects.  There is more than one way to do it.  Here is an example of one of those methods.  http://www.pathcom.com/~bracuk/code/RelatedSelects.htm

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation