Solved

I don't know why this parameter can't be determined value. Help, please!

Posted on 2003-11-17
15
190 Views
Last Modified: 2013-12-24
Oh. Sorry, I have a trouble again. Here, one of the parameter can't be determined value. I checked it several times and couldn't find the problem. Can you help me?

Here is one of the question of the survey, there are several answers, I gave them name as Att11. On the next page, I insert the answer got from the user to the database. But Att11 can't be determined.

 11. Since the end of 2001, our principal corporate officers have
            (check all that apply) </p>
          <blockquote>
             <cfinput type="checkbox" name="Att11" value="a" >
            a. had direct with federal elected/appointed officials regarding textile
            industry issues<br>
            <cfinput type="checkbox" name="Att11" value="b" >
            b. contributed to federal election compaigns of candidated expressing
            a desire to assist textile industry issues.<br>
             <cfinput type="checkbox" name="Att11" value="c" >
            c. asked members of your state's Congressional delegation directly
            for assistance with textile industry issues.


<cfset Att1='#form.Att1#'>
<cfset Att2='#form.Att2#'>
<cfset Att3='#form.Att3#'>
<cfset Att4='#form.Att4#'>
<cfset Att5='#form.Att5#'>
<cfset Att6='#form.Att6#'>
<cfset Att7='#form.Att7#'>
<cfset Att8='#form.Att8#'>
<cfset Att9='#form.Att9#'>
<cfset Att10='#form.Att10#'>
<cfset Att11='#form.Att11#'>
<cfset Att12='#form.Att12#'>
</cfif>

<cfquery datasource="WDSurvey">
update tblTextile
set Att1='#Att1#',
Att2='#Att2#',
Att3='#Att3#',
Att4='#Att4#',
Att5='#Att5#',
Att6='#Att6#',
Att7='#Att7#',
Att8='#Att8#',
Att9='#Att9#',
Att10='#Att10#',
Att11='#Att11#',
Att12='#Att12#'
Where Firmid='#session.firmid#'
</cfquery>

Why the other variables can be determined, only the Att11 can't?
0
Comment
Question by:xiaobing
  • 5
  • 3
  • 2
  • +2
15 Comments
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9763977
are you sure that q11 had a sellection made?

if so try this instead of what you have

<cfquery datasource="WDSurvey">
update tblTextile
set Att1='#form.Att1#',
Att2='#form.Att2#',
Att3='#form.Att3#',
Att4='#form.Att4#',
Att5='#form.Att5#',
Att6='#form.Att6#',
Att7='#form.Att7#',
Att8='#form.Att8#',
Att9='#form.Att9#',
Att10='#form.Att10#',
Att11='#form.Att11#',
Att12='#form.Att12#'
Where Firmid='#session.firmid#'
</cfquery>
0
 

Author Comment

by:xiaobing
ID: 9764051
Jester_48, I can't tell what's the difference from mine and yours. I tried yours, the problem remains the same.

I was told: An error occurred while evaluating the expression:

 Att11='#form.Att11#'

I can't figure it out now. Thanks!

0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9764116
the form field att11 was not submitted to the processing page
either the formfield name is not att11 or there was no selection made for the formfield att11

the difference between my suggestion and your code is that there is one less step and everytime you create a variable <cfset variableName= someValue> you are using system resources, and in this case you are assigning variable values to which you already have access to a second, redundant variable, it is not necessary
0
 

Author Comment

by:xiaobing
ID: 9764136
No, the form field att11 was submitted since I only used one form to submit all the variables. The other 11 variables work fine, only this one.

Also, I checked the firmfield name, it really is Att11.
0
 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 9764139
If a check box is not checked the form variable is not passed you will want to do an Isdefined() for each form value.

<cfquery datasource="WDSurvey">
update tblTextile
set
<cfif isdefined("form.Att1">
      Att1='#form.Att1#'
</cfif>
<cfloop from=2 to=12 step=1 index="index">
      <cfif isdefined("'form.Att#index#")>
            ,Att#index#='#evaluate('form.Att1'&index)#
      </cfif>
</cfloop>
Where Firmid='#session.firmid#'
</cfquery>
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9764145
use this to see which formfileds are being passed and their values


<CFIF ISDefined("Form.Fieldnames")>
  <table border="1">
    <CFOUTPUT>
      <CFLOOP Index="FieldName" List="#Form.Fieldnames#">
        <tr><td>Form.#FieldName#</td> <td>#Evaluate(FieldName)#&nbsp;</td></tr>
      </CFLOOP>
    </CFOUTPUT>
  </table>
</CFIF>
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 6

Accepted Solution

by:
PE_CF_DEV earned 125 total points
ID: 9764285
quick correction for my code:
<cfif isdefined("form.Att1">

Should be:
<cfif isdefined("form.Att1")>
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9766404
have you tested the new code?

are you still getting the error?
0
 
LVL 17

Assisted Solution

by:anandkp
anandkp earned 125 total points
ID: 9769038
I dont see why u are setting the form values before updating teh DB.
y the unnecessary processing ???

u'll need to have just the following code ... with 2 checks :

<CFQUERY datasource="WDSurvey">
      update tblTextile Set      
      <CFIF IsDefined('Att1') AND Len(Trim(Evaluate('Att1')))>
            Att1 = <CFQUERYPARAM CFSQLTYPE="cf_sql_varchar" VALUE="#Evaluate('Att1')#">,
      </CFIF>
      <CFIF IsDefined('Att2') AND Len(Trim(Evaluate('Att2')))>
            Att2 = <CFQUERYPARAM CFSQLTYPE="cf_sql_varchar" VALUE="#Evaluate('Att2')#">,
      </CFIF>
      <CFIF IsDefined('Att3') AND Len(Trim(Evaluate('Att3')))>
            Att3 = <CFQUERYPARAM CFSQLTYPE="cf_sql_varchar" VALUE="#Evaluate('Att3')#">,
      </CFIF>
      <CFIF IsDefined('Att4') AND Len(Trim(Evaluate('Att4')))>
            Att4 = <CFQUERYPARAM CFSQLTYPE="cf_sql_varchar" VALUE="#Evaluate('Att4')#">,
      </CFIF>
      <CFIF IsDefined('Att5') AND Len(Trim(Evaluate('Att5')))>
            Att5 = <CFQUERYPARAM CFSQLTYPE="cf_sql_varchar" VALUE="#Evaluate('Att5')#">,
      </CFIF>
      <CFIF IsDefined('Att6') AND Len(Trim(Evaluate('Att6')))>
            Att6 = <CFQUERYPARAM CFSQLTYPE="cf_sql_varchar" VALUE="#Evaluate('Att6')#">,
      </CFIF>
      <CFIF IsDefined('Att7') AND Len(Trim(Evaluate('Att7')))>
            Att7 = <CFQUERYPARAM CFSQLTYPE="cf_sql_varchar" VALUE="#Evaluate('Att7')#">,
      </CFIF>
      <CFIF IsDefined('Att8') AND Len(Trim(Evaluate('Att8')))>
            Att8 = <CFQUERYPARAM CFSQLTYPE="cf_sql_varchar" VALUE="#Evaluate('Att8')#">,
      </CFIF>
      <CFIF IsDefined('Att9') AND Len(Trim(Evaluate('Att9')))>
            Att9 = <CFQUERYPARAM CFSQLTYPE="cf_sql_varchar" VALUE="#Evaluate('Att9')#">,
      </CFIF>
      <CFIF IsDefined('Att10') AND Len(Trim(Evaluate('Att10')))>
            Att10 = <CFQUERYPARAM CFSQLTYPE="cf_sql_varchar" VALUE="#Evaluate('Att10')#">,
      </CFIF>
      <CFIF IsDefined('Att11') AND Len(Trim(Evaluate('Att11')))>
            Att11 = <CFQUERYPARAM CFSQLTYPE="cf_sql_varchar" VALUE="#Evaluate('Att11')#">,
      </CFIF>
      <CFIF IsDefined('Att12') AND Len(Trim(Evaluate('Att12')))>
            Att12 = <CFQUERYPARAM CFSQLTYPE="cf_sql_varchar" VALUE="#Evaluate('Att12')#">,
      </CFIF>
      0 = 0      
      Where Firmid = <CFQUERYPARAM CFSQLTYPE="cf_sql_varchar" VALUE="#session.firmid#">
</CFQUERY>

run this & let me know - if it works for u !

K'Rgds
Anand

PS : PE_CF_DEV  in ur code - if the Att1 is not defined - ur SQL statement wld throw error, as it wld look like "set , att2 = ...." starting with a "," !
0
 
LVL 11

Expert Comment

by:hart
ID: 9769073
What ever anand has written will work perfectly... like a charm

but just in case, do check the view source of ur form.
that is after ur form is formed just right click and do a view source.

And check for the instance of Att11.
also check wether its inside the form tags or not...

Regards
Hart
0
 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 9771065
oh yeah, I knew it wouldn't work went to get coffe came back and submited without thinking and forgot all about it...
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 10980478
mrichmon,
i think the proper answer to this question is Anand's, even PE_CF_DEV admits that his code can have unwanted results,so teh points should be awarded to anand

Jester_48  
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now