0
votes

I am trying to pass a form input to an external URL to be used somewhere else and perform a certain task. The issue I am having is actually getting the value and passing it. I either get a LotNumber is undefined or an error executing a Cfquery. I tried using CFPARAMhowever I think I misunderstand what cfparam does. Hopefully this is something simple.

Here is some code:

<table border="1" cellpadding="3" cellspacing="0" rules="GROUPS" frame="BOX" width="100%" bordercolor="#C0C0C0" bgcolor="#FFFFFF">
<thead>
<tr height="28">
    <td colspan="4"><b>Outstanding Shipping</b></td>
    <CFOUTPUT>
    <cfparam name="Show_SampleLogSheet.Passed_LotNumber" default="" />
    <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?Passed_CustomerID=#Passed_CustomerID#&Passed_ShippingAdviceID=#Get_ShippingAdvice.ShippingAdviceID#&Passed_Lot_Number=#Show_SampleLogSheet.Passed_LotNumber#&Passed_Activate=1" method="post" style="display: inline">
            <input type="hidden" name="Passed_CustomerID" value="#Passed_CustomerID#">
        <input class="frm3" type="text" name="Passed_LotNumber" value="#Show_SampleLogSheet.Passed_LotNumber#" size="3" maxlength="6" tabindex="25">
            </form>
        </td>
    </CFOUTPUT>

I really appreciate any help.

Thank you

2
1. What kind of a variable is Show_SampleLogSheet? Is it a query, struct, object? 2. Consider pushing all your variables over as hidden fields. 3. Use encodeForURL or encodeForHTMLAttribute on those variables. Who knows what they have in them. 4. OT: That is some old school HTML on the table there. Yet you are using CSS on other things. Consider 100% CSS - James A Mohler
The form name is Show_SampleLogSheet. 4. The code is ~5 years old, but I agree - G.Rose
How do you submit the form? - Shawn
Enter key and that submits the data to the url ideally - G.Rose
Funny thing is that I can use the #Passed_LotNumber# variable anywhere else. It's just that form - G.Rose

2 Answers

1
votes

For names are client side. ColdFusion does not need to name them at all. (Code has been somewhat similified

      <cfparam name="Passed_LotNumber" default="" />

I don't know what this field is good for. It is not within the form tag, so it is not going to get pushed over on submit.

      <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">

Real form starts here. Note that passed_LotNumber does not need anything

      <form name="Show_SampleLogSheet" class="frm" action="/Buying/Shipping_Advice/Index.cfm?Passed_CustomerID=#Passed_CustomerID#&Passed_ShippingAdviceID=#Get_ShippingAdvice.ShippingAdviceID#&Passed_Lot_Number=#Passed_LotNumber#&Passed_Activate=1" method="post" style="display: inline">
      <input type="hidden" name="Passed_CustomerID" value="#Passed_CustomerID#">
      <input class="frm3" type="text" name="Passed_LotNumber" value="#Passed_LotNumber#" size="3" maxlength="6" tabindex="25">

0
votes

Turns out it was some the wrong input name. Here is the fixed code:

<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">
    </form>
</td>

There was a parameter that was hidden somewhere else named Passed_Lot_Number instead of Passed_LotNumber. I apologize, this is some super crap code and it's super old thus all of these dumb headaches. Thank you everyone