Link to home
Start Free TrialLog in
Avatar of xiaobing
xiaobing

asked on

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

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?
Avatar of James Rodgers
James Rodgers
Flag of Canada image

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>
Avatar of xiaobing
xiaobing

ASKER

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!

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
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.
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>
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>
ASKER CERTIFIED SOLUTION
Avatar of PE_CF_DEV
PE_CF_DEV

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
have you tested the new code?

are you still getting the error?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
oh yeah, I knew it wouldn't work went to get coffe came back and submited without thinking and forgot all about it...
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