Ive a listbox in my coldfusion code, and when i preview it I get a list of name to select from, only thing is its always defaulting back to the first one.
Is there any way i can get it to stay at the last name ive selected rather than goining back to the first one
Heres the code im using for it
<cfparam name="url.action" default="">
<cfquery name="qgetcompany" datasource="#request.dsn#">
select COMPANY_Number,COMPANY_Name
from COMPANY
ORDER BY COMPANY_Number
</cfquery>
<cfset page = "invoicesearch">
<cfset request.currentmenu = 4>
<cfinclude template="inc_header.cfm">
<style>
#midcontent td{font-size:11px;}
</style>
<tr>
<td id="midcontenttop">
<h1>Quotes</h1>
</td>
</tr>
<cfoutput>
<tr>
<td id="midcontent">
<table cellpadding="0" cellspacing="0">
<tr>
<td id="menu" valign="top">
<cfinclude template="inc_leftmenu.cfm">
</td>
<td valign="top">
<cfif listfind(valuelist(qgetglobalmenuoptions.MENUOPTIONS_KEY),request.currentmenu) eq 0>
ACCESS DENIED
<cfelse>
<cfif url.action eq "updaterequest">
<cfinclude template="scheduledtasks/processinvoice.cfm">
</cfif>
<fieldset>
<legend>Search</legend>
<table>
<form name="search" method="post" action="dsp_searchdocs.cfm">
<tr>
<td>
<select name="COMPANY_Number">
<cfloop query="qgetcompany"><option value="#COMPANY_Number#">[#COMPANY_Number#] #COMPANY_Name#</cfloop>
</select>
</td>
<td>Invoice Number : <input type="text" name="INVOICE_Number" size="12"></td>
<td><input type="submit" value="Find »" /></td>
</tr>
</form>
</table>
</fieldset>
<cfif isdefined("form.COMPANY_Number")>
<cfif form.INVOICE_Number eq "">
<p>Your Search has returned 0 results</p>
<cfelse>
<cfquery name="qgetinvoices" datasource="#request.dsn#">
select INVOICE_DateAdded, I.COMPANY_Number,INVOICE_Number, C.COMPANY_Name, INVOICE_Key
from INVOICE I, COMPANY C
where I.COMPANY_Number = C.COMPANY_Number
AND I.COMPANY_Number = #form.COMPANY_Number#
AND INVOICE_Number = '#form.INVOICE_Number#'
</cfquery>
<table cellpadding="3" width="750">
<tr class="row4">
<th align="left">Date</th>
<th align="left">Company No.</th>
<th align="left">Invoice No.</th>
<th align="left" colspan="3">Tools</th>
</tr>
<cfloop query="qgetinvoices">
<tr class="#iif(currentrow mod 2, de("row1"), de("row2"))#">
<td>#dateformat(INVOICE_DateAdded,"dd mmm yyyy")#</td>
<td>#COMPANY_Name#</td>
<td>#INVOICE_Number#</td>
<td colspan="2"><a href="pnt_invoice.cfm?invoice=#INVOICE_Key#" target="_blank">[Print]</a></td>
</tr>
</cfloop>
</table>
</cfif>
</cfif>
</cfif>
<br/>
</td>
</tr>
</table>
</td>
</tr>
</cfoutput>
<cfinclude template="inc_footer.cfm">
Thanks

New Topic/Question
Reply




MultiQuote




|