Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

I still cannot get this to work properly

Participant ,
Nov 10, 2008 Nov 10, 2008
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
201
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 10, 2008 Nov 10, 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/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 10, 2008 Nov 10, 2008
LATEST
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/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources