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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

radio button 1

Status
Not open for further replies.

tatika

MIS
Oct 6, 2003
35
US
Hope this is clear...

I created an action form that allows users to populate records onto a table.

I would like to use radio buttons that would allow users to select from a list of options. Once a user select the button option this option will populate a field on a table called "Request".

The field on the table "Request" is what is giving me the problem. This specific field is defined on table Requests as lookup field that gets its information from linked table "TypeofRequest". TypeOfRequest is populated with a number of requests types, such as: reunion, party, other...

My problem is that once I select the radio option the action form does not recognize the radio value since it reads only one table.

Is there a way around it???

Sorry if I am not making this any clear. I'll understand if you can't provide me with a solution....

Thanks in advance :)


PS: source code for web-form request.cfm:

<form action=&quot;insert.cfm&quot; method=&quot;post&quot;>
<td><input type=&quot;radio&quot; name=&quot;party&quot; value=&quot;RequestType&quot;
</td>

<!--- where party is the name of a field in table TypeOfRequest, and value is name of field in table Request --->


Source code for Insert.cfm

<cfinsert datasource=&quot;mydatasource&quot; table=&quot;Request&quot;
 
i'm not sure i understand, but i'll give it a shot

radio buttons usually travel in bunches

(i suppose it is a matter of opinion which form element, radio button or checkbox, is appropriate when there is only one choice, so let's not go there...)

in your case i would expect to see several buttons, e.g.

<form action=&quot;insert.cfm&quot; method=&quot;post&quot;>
<p>
<input type=&quot;radio&quot; name=&quot;party&quot; value=&quot;1&quot;>Reunion<br />
<input type=&quot;radio&quot; name=&quot;party&quot; value=&quot;2&quot;>Party<br />
<input type=&quot;radio&quot; name=&quot;party&quot; value=&quot;3&quot;>Foo<br />
</p>

thus whichever choice the user makes on the form, that value is submitted

so when you do the insert into the database, the selected value gets inserted into the Requests column

thus if the value 2 is inserted, that will work in the lookup table by looking up the Party description

so how do you generate the various values of the radio buttons?

typically with a CFOUTPUT that prints out all the values/descriptions of the TypeOfRequest table

<CFQUERY NAME=&quot;requests&quot;>
select id,descr from TypeOfRequests
</CFQUERY>

<CFOUTPUT QUERY=&quot;requests&quot;>
<input type=&quot;radio&quot; name=&quot;request&quot; value=&quot;#id#&quot;>#descr#<br />
<CFOUTPUT>


rudy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top