By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,148 Members | 759 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,148 IT Pros & Developers. It's quick & easy.

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

P: 7
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, 82 views)
Feb 5 '15 #1
Share this question for a faster answer!
Share on Google+

Post your reply

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