473,395 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Need Help to get value of selected item from Select Dropdown list in cfquery under in

Form:
Expand|Select|Wrap|Line Numbers
  1. <!-- Sign up FORM -->
  2. <cfoutput>
  3.   <form  method="post" action="HomeShow_submit.cfm">
  4.     <input type="hidden" name="UserID" value="#RemoveChars(CGI.Auth_User, 1, Find('\', CGI.Auth_User))#">
  5.   <input type="hidden" name="Fname" value="#User.fname#">
  6.   <input type="hidden" name="Lname" value="#User.lname#">
  7.   <input type="hidden" name="Year" value="#DatePart('yyyy', Now())#">
  8.  
  9.     <table width="600" border="0" align="center" cellpadding="1" cellspacing="1">
  10.         <tr>
  11.   <th colspan="2" scope="col" class="Header" align="center">Home Show Sign Up Form</th>
  12.         </tr>
  13.   <tr>
  14.   <th align="left" class="red">Shifts</th>
  15.     <td><select name="ShiftsList">
  16.           <option value="" selected>  ... select a Shift</option>
  17.       <cfloop query="ShiftsList">
  18.         <option value="#ShiftsList.ShiftDetails#">#ShiftsList.ShiftDetails#</option>
  19.       </cfloop>
  20.     </select>
  21.     </td>
  22.   </tr> 
  23.  
  24.   <tr>
  25.   <td colspan="2" align="center"><input type="submit" NAME="SubmitForm"  value="Submit"></td>
  26.   </tr>
  27.     </table>
  28.   </form>
  29. </cfoutput>
  30.  
ActionPage
-------------------
Expand|Select|Wrap|Line Numbers
  1. <cfquerydatasource="HomeShow"  name="InsertHomeShow">
  2. INSERT INTO HomeShow
  3.   VALUES
  4.   ('#Form.USERID#',
  5.   '#Form.Fname#',
  6.   '#Form.Lname#',
  7.   '#Form.Year#'
  8.   ?
  9.  
Question: This is where I need help, suppose we choose option with value =1 i.e. Friday March 20th 10.00 a.m to noon. I want to get value i.e 1 in Insert statement. So What I can write in side Insert statement to get that value. Please look at the attachment for Pic of Select html body
Expand|Select|Wrap|Line Numbers
  1.               )
  2. </cfquery>
  3.  
Attached Images
File Type: jpg sofia.jpg (113.2 KB, 152 views)
Feb 5 '15 #1
0 6605

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Lisa | last post by:
I have a drop down that defaults to "select" after the page refreshes. How do I keep the selected value in the dropdown field... I've tried EVERYTHING and nothing works! :( <script...
3
by: rohith | last post by:
Hope someone can help with this. I am trying to add items to a drop down list from a database. I can do this fine by using the bind method. What I want to do also is to set the selected item to...
3
by: Big Dave | last post by:
I know it's been asked a million times before, but I still can't seem to find an answer that works. I've got a dropdown list in the footer template of a datagrid. The dropdown list databinds,...
5
by: Joe Fallon | last post by:
I have a list box with 7 text values in it. I have a pair of buttons to Move Up or Move Down the selected item one position. What is the simplest way to code the buttons so the item moves one...
5
by: =?Utf-8?B?bWNhdWxpZmZl?= | last post by:
I have an old application ( pre-VB5) that I need to add a select/option list to. This is an edit program so the values for the form will be retrieved from a database. How do I set the value of...
3
by: peter.mosley | last post by:
I've tried googling for the answer to this problem, without any luck. I'm sure the truth must be out there somewhere! I have a multiselect listbox populated with many items (set by the RowSource...
1
by: preethiramu | last post by:
how to get the selected item by using list box in vc++?
3
by: niths | last post by:
hello everybody, i had created a dropdown in which project names will be appeared. and i am getting those project name from backend. Below that dropdown i am having a table of users with a check...
1
by: drinksoda | last post by:
how do i get a selected item in the list box.... i have my code to play a mp3....but cant get the listbox item here is my code #define _WIN32_IE 0x0300 // includes
0
by: yashpal22 | last post by:
How to hide selected item in dropdown in other dropdown?in c#
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.