473,322 Members | 1,232 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,322 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, 151 views)
Feb 5 '15 #1
0 6550

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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.