OK - I've had good luck with this list lately and I'm pulling my hair out on
this - there has to be an answer!
I'd just like to display to the user a list (multi-row-like) of document ids
and a blank box for entering in train dates. When the user hits submit I'd
like to update a table with the new dates. CFGRID and CFGRIDUPDATE both
work for this purpose, but there is one catch for my application. There may
be duplicate docids for an employee based on another key field in the table,
subdept. So I really don't want to display all those duplicates to the end
user - just let them see docid and the blank box for the date, then have it
"behind the scenes" update the date for all instances (subdept) of the
docid. CFGRID doesn't like this since any key field needs to be included
and deptcode is a key field. I've done something similar to this by using
a concatenated field and then using the evaluate() function on the next
page, but that was with a checkbox not a date field and the checkbox allows
me to assign a concatenated "value" along with a name. How do I do that
with an input text box? Here's some code which works great for a checkbox
but I want to do the same for a date (text) box (with an update instead of a
insert). So how would this work if the first line below was a date field?
I guess the issue is how you can assign a "value" to a checkbox to be passed
to the next page but with an input text box if you assigned a value it would
show up on the entry form.
<input type="checkbox" name="check" checked value="#fullfileid##deptcode#">
</td>
<td>
#LSNumberFormat(employeeno,99999)#
</td>
<td>
#docid#
</td>
<td>
#Title#
</td>
<td>
#DeptCode#
</td>
</tr>
<input type="hidden" name="empid#docid##deptcode#"
value="#LSNumberFormat(employeeno,99999)#">
<input type="hidden" name="deptcode#docid##deptcode#" value="#deptcode#">
<input type="hidden" name="docid#docid##deptcode#" value="#fullfileid#">
</cfoutput>
Processing Page:
<cfloop index="doc" list="#form.check#">
<cfquery name="addtorec" datasource="docs">
insert into tblemployee_train(employeeno,fullfileid,deptcode,dateadded)
values(#evaluate('form.empid'& doc)#,'#evaluate('form.docid'&
doc)#','#evaluate('form.deptcode'& doc)#',#Now()#)
</cfquery>
</cfloop>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists