RSS Forums RSS
Please support our ColdFusion advertiser: Programming Forums
Views: 3819 | Replies: 1 | Solved | Thread Tools  Display Modes
Reply
Join Date: Apr 2006
Posts: 29
Reputation: Stewie is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
Stewie Stewie is offline Offline
Light Poster

Trying to return query results

  #1  
Jun 9th, 2006
I have a form set up with 3 select lists where a user can select the date. and from there I insert it into one field in an Access database using this query.
<cfquery name="CheckDate" datasource="Rumors_Forms">
INSERT INTO BusTable (Name, Req_Date, Req_Time, Address, Email, PhoneNumber, Reason)
 Values('#form.Name#', '#form.Month#/#form.Day#/#form.Year#' ,'#form.Req_Time#','#form.Address#','#form.Email#','#form.PhoneNumber#','#form.Reason#')
</cfquery>

it inserts into the DB just fine, what I would like to do, is have all the information output to a form. The thing I am having problems with is getting the date to populate in 3 select lists. here is my code that I have for the select lists.
[html]
<td>Date:</td>
<td><cfparam name="form.month" default=""> <select name="Month">
<cfloop index="month" from =1 to =12 >
<cfif month EQ form.month>
<cfoutput><option value="#month#" selected>#month#</option></cfoutput>
<cfelse>
<cfoutput><option value ="#month#">#month#</option></cfoutput>
</cfif>
</cfloop>
</select>

<cfparam name="form.day" default="">

<select name="Day">
<cfloop index="day" from =1 to =31 >
<cfif day EQ form.day>
<cfoutput><option value="#day#" selected>#day#</option></cfoutput>
<cfelse>
<cfoutput><option value ="#day#">#day#</option></cfoutput>
</cfif>
</cfloop>
</select>

<cfparam name="form.year" default="">

<select name="Year">
<cfloop index="year" from =2006 to =2010 >
<cfif year EQ form.year>
<cfoutput><option value="#year#" selected>#year#</option></cfoutput>
<cfelse>
<cfoutput><option value ="#year#">#year#</option></cfoutput>
</cfif>
</cfloop>
</select></td>
[/html]

Any help would be great.
Thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2006
Posts: 29
Reputation: Stewie is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
Stewie Stewie is offline Offline
Light Poster

Re: Trying to return query results

  #2  
Jun 9th, 2006
I was able to get that problem solved
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the ColdFusion Forum
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 6:02 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC