********************************************************************** WESTMINSTER CITY COUNCIL Please refer to the disclaimer beneath this message **********************************************************************
The data returned from the form is used to update a table in the database. My form returns all the original data in a db, the user can then amend anything they want, either by checking another radio button or changing some text in a text box. Then they can submit the form and this should update the original data. -----Original Message----- From: Sam Farmer [mailto:[EMAIL PROTECTED]] Sent: 20 September 2002 15:30 To: CF-Talk Subject: Re: Referencing a dynamically named form field My first question is, what are you trying to do with the data that is returned from the form? I think you are on the right path but might be getting muddled along the way. For instance, by giving each radio button a different name you are negating the use of radio buttons because it becomes possible for the user to select each one on the page. Sam ----- Original Message ----- From: "Adams, Stephen" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Friday, September 20, 2002 10:18 AM Subject: Referencing a dynamically named form field > ********************************************************************** > WESTMINSTER CITY COUNCIL > Please refer to the disclaimer beneath this message > ********************************************************************** > > Hi, > > I have created a form that is populated by a query, like this: > > > <form> > <cfoutput query="query"> > First Name: <input type="text" name="firstname" value="#firstname#"> > Last Name: <input type="text" name="lastname" value="#lastname#"> > <input type="radio" name="linkSection#CurrentRow#" value="MyContent" > <cfif myLinks_section EQ "content">checked</cfif> > <input type="radio" name="linkSection#CurrentRow#" > value="MyDepartment" <cfif myLinks_section EQ "department">checked</cfif>> > <input type="radio" name="linkSection#CurrentRow#" > value="MyWesminster" <cfif myLinks_section EQ "westminster">checked</cfif>> > > </cfoutput> > </form> > > As you can see I have used an cfif statement to see which radio button > should be checked according to the queries results. I have had to use the > CurrentRow to give each set of checkboxes an individual name, so that they > don't over write each other when selected. This gives me a set of form > fields with names like linkSection1 and linkSection2, depending on how many > results are returned by my query. > > The problem I am having is referencing these checkboxes in my form action > page. I could just go <cfoutput>#FORM.linkSection1#</cfoutput> or > <cfoutput>#FORM.linkSection2#</cfoutput>, but the problems is I don't know > how many there will be. My query could return either 2 different results or > 50, that means I need to output either #FORM.linkSection1# to > #FORM.linkSection50#. > > My question is how can I call the form field no matter how many are passed. > > I have tried this: > > <cfloop index="index" from="1" to="#ListLen(FORM.firstname)#"> > <cfset FORM.linksSection = FORM.linksSection + #index#> > <cfoutput>#FORM.linksSection#</cfoutput> > </cfloop> > > but it failed. > > Any one got any ideas? > > Thanks > > Stephen > > > ********************************************************************** > Westminster City Council switchboard: > +44 20 7641 6000 > ********************************************************************** > This E-Mail may contain information which is > privileged, confidential and protected from > disclosure. If you are not the intended recipient > of this E-mail or any part of it, please telephone > Westminster City Council immediately on receipt. > You should not disclose the contents to any other > person or take copies. > ********************************************************************** > > ______________________________________________________________________ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists