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

Radio Button not posting info to table

New Here ,
Sep 10, 2007 Sep 10, 2007

Copy link to clipboard

Copied

The user adds master header information and hits submit, which selects a list from the DB depending upon the user's criteria. This list now allows the user to select (cclselect) Yes, No, or NA for each list item, which is a radio button. I'm having issues getting cclselect and the list to post to another table. I would appreciate any help someone could give me on this issue.
TOPICS
Advanced techniques

Views

1.3K

Translate

Translate

Report

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
Guest
Sep 10, 2007 Sep 10, 2007

Copy link to clipboard

Copied

Please fix the following and run your code
<tr>
<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>
</tr>

Votes

Translate

Translate

Report

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
New Here ,
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

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
Guest
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

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#" "

Votes

Translate

Translate

Report

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
New Here ,
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

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!

Votes

Translate

Translate

Report

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
Guest
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

Add <cfparam> at the top
<cfparam name="cclselect" default="">

the value for default could be according to the program requirement.

Let me know

Votes

Translate

Translate

Report

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
New Here ,
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

I tried many variations of the cfparam and continue to get Element cclselect is undefined in form.

Votes

Translate

Translate

Report

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
Guest
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

Do you have another query named "get Element".
Please send the error message as it appears.

Thanks

Votes

Translate

Translate

Report

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
New Here ,
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

No, I do not have another query named "getElement". This is the exact error verbiage:
Diagnostics:
Element CCLSELECT is undefined in FORM.
The error occurred on line 79.

Votes

Translate

Translate

Report

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
Guest
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

Is line 79 on the CF page ,the following
'#form.cclselect#currentrow##',

Votes

Translate

Translate

Report

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
New Here ,
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

yes

Votes

Translate

Translate

Report

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
Guest
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

The # sign cannot be nested
'#form.cclselect##currentrow#',

try the above

Votes

Translate

Translate

Report

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
Guide ,
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

jjonney wrote:
> '#form.cclselect##currentrow#',

You need to use array notation to retrieve the form field value.

#form["cclselect"& yourIndex ]#

Votes

Translate

Translate

Report

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
New Here ,
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

I'm sorry, I don't understand what I would use as the index part of the statement.

Votes

Translate

Translate

Report

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
Guide ,
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

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 ]>
....
</cfloop>

Btw, this code looks awfully familiar. Did you post something similar recently?

Votes

Translate

Translate

Report

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
New Here ,
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

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!!

Votes

Translate

Translate

Report

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
Guide ,
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

> #ucase(form.cclselect)#

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.

Votes

Translate

Translate

Report

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
New Here ,
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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
New Here ,
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

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
Guide ,
Sep 11, 2007 Sep 11, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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
New Here ,
Sep 12, 2007 Sep 12, 2007

Copy link to clipboard

Copied

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!

Votes

Translate

Translate

Report

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
Guide ,
Sep 12, 2007 Sep 12, 2007

Copy link to clipboard

Copied

LATEST
> 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.

Votes

Translate

Translate

Report

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
Documentation