It is easier to do this with checkbox fields, because you can simply loop
through the field name var in your action page as it will become a comma
delimited list. You can's use cfinput, you'll have to use regular form
fields. If you insist on using radio buttons I think you could do something
like this:

in the form page:

<cfouput query = "employees>
    <cfinput name = "mybtn_#emp_id# ....>
</cfouput>

in the action page:

<cfloop list = "fieldnames" index = "my_field">
    <cfif ListFirst(my_field) eq "mybtn">
        <cfquery name = update_emp>
            UPDATE Employees
            SET EmpStatus = '#Evaluate(my_field)#'
            WHERE Emp_ID = #ListLast(my_field)#
        </cfquery>
       </cfif>
</cfloop>

----- Original Message -----
From: "Gavin Myers" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, October 02, 2000 3:31 PM
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/cf-talk@houseoffusion.com/
> 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/cf-talk@houseoffusion.com/
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