This content has been marked as final. Show 21 replies
Please fix the following and run your code
<td><input type="radio" name="cclselect#currentrow#" value="Yes"></td>
<td><input type="radio" name="cclselect#currentrow#" value="No"></td>
<td> <input type="radio" name="cclselect#currentrow#" value="N/A"
<cfif #ccdirect# is "NO" and #cklstdirflg# is "YES"> checked</cfif>></td>
<td class="maroon12b"> #cklstdirflg#</td>
<td class="maroon12b"> #cklstapply#</td>
<td class="maroon12b"> #cklstnum#</td>
<td class="maroon12b"> #cklstdesc#</td>
Thanks so much...it's always the little things.
But now I'm getting an error that the value is too large for cclselect (actual 11, maximum 10). That field size is 10 but I don't see where's it's coming up with a value of 11 when the entry will be Yes, No or N/A. Any ideas?
You are welcome
Please copy,cut and past the error with more description as I am not able to follow.
And also what is the value of "cclselect#currentrow#" "
I figured out part of my problem.. but now I'm getting "Element CCLSELECT is undefined in FORM". "cclselect#currentrow# is a Yes, No, N/A user input and I've added the #currentrow# so that specific rows that meet a certain criteria will have N/A already chosen for the user. I've reattached the code. Thanks!
Add <cfparam> at the top
<cfparam name="cclselect" default="">
the value for default could be according to the program requirement.
Let me know
I tried many variations of the cfparam and continue to get Element cclselect is undefined in form.
Do you have another query named "get Element".
Please send the error message as it appears.
No, I do not have another query named "getElement". This is the exact error verbiage:
Element CCLSELECT is undefined in FORM.
The error occurred on line 79.
Is line 79 on the CF page ,the following
The # sign cannot be nested
try the above
You need to use array notation to retrieve the form field value.
#form["cclselect"& yourIndex ]#
I'm sorry, I don't understand what I would use as the index part of the statement.
If you're inserting multiple rows, your action page would contain a loop. Use your loop's index variable name. For example
<cfloop from="1" to="#someNumber#" index="yourIndex">
<cfset currentCCSelectValue = form["cclselect"& yourIndex ]>
Btw, this code looks awfully familiar. Did you post something similar recently?
Thanks for the "lesson" - I'm still learning and really appreciate you'll taking time to answer questions. I will work with your information to see if I can get it working.
Yes, I posted code pertaining to the loop with radio buttons needing N/A selected if fields met certain criteria and got that part working great. Thanks!!
I haven't looked over all of your code, but wanted to ask. You're not trying to insert a csv list of values like this "1,23,4,568,9" into a single column right? 'Cause that is a bad idea all around :)
> Yes, I posted code pertaining to the loop with radio buttons
Ah, ok. I thought seemed a bit familiar.
No. (Screen 1).The user inputs some data, from the criteria of that data a list is displayed (Screen 2) that has radio buttons to select yes, no and N/a. Then the next action (Screen 3) will display the list with their inputs so they can have the option to print. So I'm trying to loop through the list that is displayed on screen 2 so it will update the database and display screen 3.
Okay, my cfloop has to be a query so that it can sort throught my if conditions and unless I'm missing something in my book resarch, I cannot put an index on a cfloop query. So how would I go about calling this loop in the update to the DB?
No, it doesn't have to be a query. You could use a from/to loop. Take your form. You could create a hidden field to store the number of records. When the form is submitted, use the form field value in your cfloop.
I've been working with the sample you sent and am now getting this error:
unique constraint (LOG_WEB.PK_CCCKLSTID) violated
The error occurred on line 91.
I've attached the portion of the code that we've been working on. Thanks!
> unique constraint (LOG_WEB.PK_CCCKLSTID) violated
That means the table has a constraint that doesn't allow duplicates on one of the values you're trying to insert. From the name its probably #variables.cccklstid#. Is the Log_web.cccklstid column the table's PK (primary key)? You cannot have duplicate primary keys.