Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form actionpage - element not defined - variable passing problem

Status
Not open for further replies.

kydavis

MIS
Nov 16, 2005
6
CA
I keep gettting the error that the element bandname is not defined in bandform.

Here is my code:

Code:
<table border="1">
    <tr>

        <form id="bandform" action="testaction.cfm" method="post" name="bandform">
<cfloop from="1" to="#showNum#" index="i">
    <tr>
            <td>
            <cfoutput>
                <p><input type="checkbox" name="bandname" value="#getItems.bands_id[ListGetAt(randomItems, i)]#" id="picture">#getItems.bands_name[ListGetAt(randomItems, i)]#</p>
            </cfoutput>
            </td>
    </tr>
 </cfloop>

             <p><input type="submit" name="submitButtonName"></p>

        </form>

    </tr>
    </table>

</cfif>
The above code gets me a random list of ten band id's (picture id's). Then when I try and review the results on the testaction.cfm I get the error that BANDNAME is not an element of BANDFORM. I dont understand what I am doing wrong. Here is my code on the action page:

Code:
<cfoutput>
    #bandform.bandname#
</cfoutput>
i JUST WANT TO SEE the results of the variables. What the ID was of the pictures that the user selected on the screen. Why am I getting it wrong?
 
Try this:
Code:
<cfoutput>
    #[red]form[/red].bandname#
</cfoutput>


Hope This Helps!

ECAR
ECAR Technologies, LLC

"My work is a game, a very serious game." - M.C. Escher
 
But i named the form bandform. does that not matter?
 
nope. it doesn't. the name of the form is moot after the page is submitted. The variables and values come back in the form scope (if method="post") or url scope (if method = "get")

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top