Solved

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

Posted on 2003-11-17
15
200 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

 

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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

734 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