Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
cascadiaweb #1
extracting form data
I have a form that allows you to change responses for a list of users. Each
user has a line with options. THE FIELD NAME IS DETERMINED BY THE USERID. So
the field name for userid 4327 is answer_4327 and so on. The page has up to
500 user answers that can be manipulated.
<input type="Radio" name="answer_#userid#" value="Y">Yes
<input type="Radio" name="answer_#userid#" value="N">No
<input type="Radio" name="answer_#userid#" value="M">Maybe
When I send the answers to the process page, I don't know how to get at the
data. First I loop through all users taking the test.
<cfloop query="users_taking_test">
On each pass, I verify that the form.field exists for each user I am seeking
to process.
<cfif isdefined("form.status_#userid#")>
Once I determine the form field exists, I am stumped as to how to get at the
data in it!
I can't say: <cfset new_answer = form.status_#userid#>
And putting it in quotes doesn't work:
<cfset new_answer = "form.status_#userid#"> makes new_answer =
"form.status_4327 " rather than the value of the form field (Y,N or M)
Ideally, I'd like to be able to enter the data directly into the db:
<cfquery datasource="#application.chatdb#" dbtype="ODBC" name="update">
UPDATE test_answers SET answer = '#form.status_#userid##'
WHERE testID = #form.testid# and userid=#userid#
</cfquery>
I can't figure it out. Does anyone know how to extract the value of the form
field that uses this unusual naming convention
thanks in advance!
jim
:confused;
cascadiaweb Guest
-
Extracting value from data within an element.
Hello forum. I have written a perl script that will parse XML files and extract certain elements and put them into a comma delimited file. This... -
Extracting Data from Datagrid
I have a developer that wants to dump data from a datagrid to an external file. I am thinking a .csv file for simplicity sake. I had thought about... -
extracting data from a value list
Hi all, What I'd like to do is extract the data from a value list of "categories" and paste the data into a repetitive text field. I'm able to... -
Extracting web data
Can anyone point me to java packages which aid in parsing web pages? TIA matt -
Extracting data from the Internet
I'm a newbie with Perl and can extract data from Web Pages, but need guidance on how to use perl to extract files from websites that you would... -
PaulH #2
Re: extracting form data
assuming you're on a relatively modern version of cf, this should work:
<cfset new_answer = form["status_#userid#"]>
btw that's seems like an unreaonsable amount of complication for a form.
PaulH Guest



Reply With Quote

