Skip to main content
Known Participant
November 24, 2008
Question

Need help in field validation

  • November 24, 2008
  • 3 replies
  • 645 views
I query a table by poNumber and retrieve two line items. Each line items consists of columns conditionCode, partNumber, quantity, serialNumber. Each part number can have multiple serial numbers, so if the quantity is five, there are five serial numbers.

I output using cfoutput and group, using the line ID to distinguish each row. The conditonCode, partNumber and quantity columns appear only once since they are all the same. The serial number appears multiple times since they are all different.

<cfoutput query="qryName" group="partNumber">
<tr>

<td valign="top" class="TitleText">
<cfinput type="text" name="conditionCode#ID#" value="#conditionCode#">
</td>

<td valign="top" class="TitleText">
<cfinput type="text" name="partNumber#ID#" id="partNumber" value="#partNumber#">
</td>

<td valign="top" class="TitleText">
<cfinput type="text" name="quantity#ID#" id="quantity" value="#quantity#">
</td>

<td valign="top" class="TitleText">
<cfinput type="text" name="serialNumber#ID#" id="quantity" value="#qryName.quantity#">
</td>

I have no problem updating a table. But my question is, how do I edit/validate this ? For example, if condtionCode is requried and must be A, J, X only, how do I validate, with the #ID# in each name ?
    This topic has been closed for replies.

    3 replies

    Inspiring
    November 25, 2008
    <cfinput name = "constant#variable# required="yes" validate="integer"
    message="You need a message or this won't work">
    Inspiring
    November 25, 2008
    What exactly are you trying to validate?
    Known Participant
    November 25, 2008
    For each field, I need to make sure that an entry is made and not left blank, and for the qunatity, validate that the entry is numeric only.

    I know how to do it if they are just single fields withtout the #id#, but with the #id# attached, my method does not work and I do not know how to call it.
    Inspiring
    November 24, 2008
    Make it a select instead of a text box.
    Known Participant
    November 25, 2008
    I know I can use the select for the condition code, but how do I validate the others , with the #ID# attached ?