Good afternoon,
I have 3 tables in a database called Invoicing. The main table is called MonthlyCharges and contains fields such as MonthlyChargesid, client (which relates to a field ClientID in the 2nd table called ClientTable and contains fields such as ClientID, ClientName, ClientDetails etc), unit (which relates to unitID in the Units table which contains fields such as UnitID, UnitName etc), Amount etc.
When a new record is created, I want the person adding a new record to be able to select from dropdowns for the clients and units, populated by queries for the 2 other tables. When editing, the same dropdowns will appear and selected on the item which was selected when the record was created.
This is an example of the code in the edit page; I don't know how to write the CFIF code which would select in a dropdown the chosen client and then send the relevant clientid to write to the database in the ation page.
<cfoutput query="UpDateclient">
<cfform action="update_action.cfm" method="Post">
<tr>
<td>ID </td>
<td><cfinput name="ClientMonthlyCharge_ID" type="hidden" value="#ClientMonthlyCharge_ID#" size="50"></td>
</tr>
<tr>
<td>Contact Name </td>
<td><cfinput name="ContactName" type="text" value="#ContactName#" size="50"></td>
</tr>
<tr>
<td width="111">Rate</td>
<td width="457"> <cfinput type="Text" name="Rate" value="#Rate#" size="50"></td>
</tr>
<tr>
<td>Rate Unit</td>
<td> <cfinput type="Text" name="RateUnit" value="#RateUnit#" size="50"></td>
</tr>
<!--<tr>
<td>Client</td>
<td> <cfinput type="text" name="Client" value="#Client#" size="50"></td>
</tr>-->
<tr>
<td> </td>
<td><cfinput type = "submit" name="update" class="button" value = "Update"
onClick="return confirm('Are You Sure You Want To Update This Record?');"></td>
</tr>
</cfform>
</cfoutput>
I hope this makes sense and thank you in advance for your help.
Many thanks.
I have 3 tables in a database called Invoicing. The main table is called MonthlyCharges and contains fields such as MonthlyChargesid, client (which relates to a field ClientID in the 2nd table called ClientTable and contains fields such as ClientID, ClientName, ClientDetails etc), unit (which relates to unitID in the Units table which contains fields such as UnitID, UnitName etc), Amount etc.
When a new record is created, I want the person adding a new record to be able to select from dropdowns for the clients and units, populated by queries for the 2 other tables. When editing, the same dropdowns will appear and selected on the item which was selected when the record was created.
This is an example of the code in the edit page; I don't know how to write the CFIF code which would select in a dropdown the chosen client and then send the relevant clientid to write to the database in the ation page.
<cfoutput query="UpDateclient">
<cfform action="update_action.cfm" method="Post">
<tr>
<td>ID </td>
<td><cfinput name="ClientMonthlyCharge_ID" type="hidden" value="#ClientMonthlyCharge_ID#" size="50"></td>
</tr>
<tr>
<td>Contact Name </td>
<td><cfinput name="ContactName" type="text" value="#ContactName#" size="50"></td>
</tr>
<tr>
<td width="111">Rate</td>
<td width="457"> <cfinput type="Text" name="Rate" value="#Rate#" size="50"></td>
</tr>
<tr>
<td>Rate Unit</td>
<td> <cfinput type="Text" name="RateUnit" value="#RateUnit#" size="50"></td>
</tr>
<!--<tr>
<td>Client</td>
<td> <cfinput type="text" name="Client" value="#Client#" size="50"></td>
</tr>-->
<tr>
<td> </td>
<td><cfinput type = "submit" name="update" class="button" value = "Update"
onClick="return confirm('Are You Sure You Want To Update This Record?');"></td>
</tr>
</cfform>
</cfoutput>
I hope this makes sense and thank you in advance for your help.
Many thanks.