Skip to main content
Inspiring
November 11, 2008
Question

I still cannot get this to work properly

  • November 11, 2008
  • 2 replies
  • 229 views
I have a form where I disply multiple line items from a query.

My prior code used #currenttrow# but someone suggest that I use a unique key identifier in the record, so now my code looks like this :

<tr>
<td valign="top" class="TitleText">
<cfinput type="text" name="conditionCode#gfmPartNumberID#" id="conditionCode" value="#conditionCode#" required="Yes" message="Condition Code must be entered.">
<input type="hidden" name="gfmPartNumberID" value="#qryView.gfmPartNumberID#">
</td>
<td valign="top" class="TitleText">
<cfinput type="text" name="materialNumber#gfmPartNumberID#" id="materialNumber" value="#materialNumber#" required="Yes" message="Material Number must be entered.">
<input type="hidden" name="gfmPartNumberID" value="#qryView.gfmPartNumberID#">
</td>
<td valign="top" class="TitleText">
<cfinput type="text" name="unitValue#gfmPartNumberID#" id="unitValue" value="#dollarformat(qryView.unitValue)#" required="Yes" validate="integer" message="Unit Value must be entered and must be numeric.">
<input type="hidden" name="gfmPartNumberID" value="#qryView.gfmPartNumberID#">
</td>
<td valign="top" class="TitleText">
<cfoutput group="serialNumberID"><cfinput type="text" id="serialNumber" name="serialNumber" value="#qryView.serialNumber#" required="Yes" message="Serial Number must be entered.">
<input type="hidden" name="serialNumberID" value="#qryView.serialNumberID#">

I still cannot get the validation to work. Since it is cfinput, I tried to used required, but nothing happens. Is that becuase the names are the same ? I thought the gfmPartNumberID would make each field unique ?

If cfinput requried will not work, can I validate with javascript ? If yes, how does the field name unitValue#gfmPartNumberID#" defined ? I usually have document.form.fieldname.value == 0.

I looked at my old code and it validates on the server side but the boss wants it on the client side. What do I do to solve this onece and for all ?

Thanks
    This topic has been closed for replies.

    2 replies

    Inspiring
    November 11, 2008
    and what do you need all those hidden name="gfmPartNumberID" fields for?
    get rid of them, since they don't even hold unique gfmPartNumberID...

    if you need a list of unique gfmPartNumberID from your query in a hidden
    field, then just add one field to your form:
    <cfinput type="hidden" name="gfmPartNumberID"
    value="#valuelist(qryView.gfmPartNumberID)#" />


    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    Inspiring
    November 11, 2008
    try adding #gfmPartNumberID# to the ID attributes of your cfinput tags,
    or remve the ID attributes altogether - cf adds them automatically
    itself. i think cf form field validation is actually based on the ID,
    not NAME of the field... if so, then, yes, to CF all your fields are the
    same still...

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/