Hello I am trying to pass a variable who's value would come from a form input to a Query to retrieve a value and pass back to the form as a hidden value.Very confusing, and I hope I am overthinking this. I am getting a Passed_Lot_Number
is undefined error.
Here is the code I have so far:
<CFOUTPUT>
<cfquery name = "OutputDetails" datasource = "#Application.PrimaryDataSource#">
SELECT ShippingAdviceID
FROM ShippingAdvice
WHERE CustomerID = #Passed_CustomerID#
AND LotNumber = #Passed_Lot_Number#
</cfquery>
<td align="left" colspan="1">
<input class="frm3" type="text" id="Outstanding_Passed_LotNumber" size="3" maxlength="6" tabindex="25">
<form name="Show_SampleLogSheet" class="frm" action="/Buying/Shipping_Advice/Index.cfm" method="post">
<input type="hidden" name="Passed_CustomerID" value="#Passed_CustomerID#">
<input class="frm3" type="text" name="Passed_Lot_Number" size="3" maxlength="6" tabindex="25">
</form>
</td>
</CFOUTPUT>
Forgive me, this code is really old and I have been tasked to adding some more functionality to it. I really appreciate any help.
Thank you
Edit:
Here is some updated code:
<CFOUTPUT>
<td align="left" colspan="1">
<input class="frm3" type="text" id="Outstanding_Passed_LotNumber" size="3" maxlength="6" tabindex="25" style="background-color: ##838383;border:1px solid ##000000; color:white">
<form name="Show_SampleLogSheet" class="frm" action="/Buying/Shipping_Advice/Index.cfm" method="post" style="display: inline">
<input type="hidden" name="Passed_CustomerID" value="#Passed_CustomerID#">
<input class="frm3" type="text" name="Passed_Lot_Number" size="3" maxlength="6" tabindex="25">
<cfif structKeyExists(form, "Passed_Lot_Number ")>
<cfquery name = "OutputDetails" datasource = "#Application.PrimaryDataSource#">
SELECT ShippingAdviceID
FROM tblShippingAdvice
WHERE CustomerID = #Passed_CustomerID#
AND LotNumber = #Passed_Lot_Number#
<cfreturn Passed_ShippingAdviceID />
</cfquery>
</cfif>
<input type="hidden" name="Passed_ShippingAdviceID" value="#Passed_ShippingAdviceID#">
</form>
</td>
</CFOUTPUT>