1. A crazy idea that I have used before

-----form
<cfquery>
 select * from names
</cfquery>
<cfform>
Who woule you like to fire?
<cfoutput>
#emp_name# <cfinput name="fired" type = "radio" value = "0@#emp_name#"
checked>No<cfinput name="fired" type = "radio" value = "1@#emp_name#">Yes
</cfoutput>
<input type = "submit" value = "submit">
</cfform>

-----action

you get a FORM.fired that looks like "0@roy,1@joe,1@billy,0@gus"
<cfloop index="f" list="#FORM.fired#">
  v=ListGetAt(f, 1, '@')
  empname=ListGetAt(f, 2, '@')
  <!--- start firing those guys --->
</cfloop>

or something like that.  I did not test it of course.

2. Or you could just play with the "Evaluate" function as
#Evaluate("FORM."&emp_name)# where you still need to get the emp_name
somehow.

FYI I added checked to no, just in case you want a default.  Or you could
check to see if emp_name is "Steve Jobs" and set that to "Yes" (Based on the
murdering of NASDAQ.)


<Jaime/>



> -----Original Message-----
> From: Gavin Myers [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 02, 2000 2:31 PM
> To: CF-Talk
> Subject: dynamic form
>
>
> this is buggin' me
> okay, lets say the database consists of:
>
> emp_name
> roy
> joe
> billy
> gus
>
>
> cf_code (simplified)
>
> <cfquery>
> select * from names
> </cfquery>
> <cfform>
> Who woule you like to fire?
> <cfoutput>
> #emp_name# <cfinput type = "radio" value = "0">No<cfinput type = "radio"
> value = "1">Yes
> </cfoutput>
> <input type = "submit" value = "submit">
> </cfform>
>
>
> In order for this to work i have to specify a name so my radio
> buttons will
> work. In order to give my radio buttons a name i have to give
> them a dynamic
> name (like #emp_name#)
>
> so when i go to my next page, how do i call those dynamic set feild names?
>
> like #form.#emp_name##?
>
> know what i mean?
> ------------------------------------------------------------------
> ----------
> --
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in
> the body.
> ------------------------------------------------------------------
> ------------
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to