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

Drop down list Action form

Status
Not open for further replies.

azrobert

Programmer
Apr 27, 2002
392
0
16
US
This is probably a basic question but has been driving me nuts for hours.

I have a submit form with a dropdown box with the options populated form a database, this form is submited to an action form that will eventually insert order to database.

in the action form I am able to get the value for qty entered but can not figure out how to get the selected option in the drop down box


Submit Form Code: (only showing where I populate drop down)

<cfif GetProducts.Options is 1>
<div align="left"></div>
<cfquery datasource="ConTest"name="GetOptions" username="Robert"password="3215Az">
Select * From Options
Where OptionType = #GetProducts.prodType#
</cfquery>
<select name="Option<cfoutput>#GetProducts.ProdNum#</cfoutput>">


<CFOUTPUT QUERY="GetOptions<OPTION VALUE="#OptionValue#">#OptionName#</OPTION>
</CFOUTPUT>


"Action Form" Code

<cfloop index="id" list="#form.listofids#" delimiters=",">

<cfset Qty = "#Evaluate("form.Qty#id#")#">
<cfset Qty = Evaluate(Qty)>
</cfloop>



<P><cfoutput>#Qty#</cfoutput></P>



How would I get the select option from The submit page ?

Any help is greatly appreciated
 
If you did a copy/paste then your code has several structural errors.

change:
Code:
<select name="Option<cfoutput>#GetProducts.ProdNum#</cfoutput>">
    

<CFOUTPUT QUERY="GetOptions<OPTION  VALUE="#OptionValue#">#OptionName#</OPTION>
</CFOUTPUT>

to:
Code:
<cfoutput>
  #GetProducts.ProdNum#<br />
 </cfoutput>
<select name="Option">
  <CFOUTPUT QUERY="GetOptions">
  <OPTION  VALUE="#OptionValue#">#OptionName#</OPTION>
 </CFOUTPUT>
</select>

I have no idea what all you're doing on the action page but try this to get the selected value:
Code:
<output>
 #Form.Option#
</cfoutput>

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Thanks for the assistance, still new to CF but thinking I am really going to like it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top