Quantcast
Channel: Adobe Community : Unanswered Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 5794

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

$
0
0

Form:

<!-- Sign up FORM -->
<cfoutput>
  <form  method="post" action="HomeShow_submit.cfm">
    <input type="hidden" name="UserID" value="#RemoveChars(CGI.Auth_User, 1, Find('\', CGI.Auth_User))#">
  <input type="hidden" name="Fname" value="#User.fname#">
  <input type="hidden" name="Lname" value="#User.lname#">
  <input type="hidden" name="Year" value="#DatePart('yyyy', Now())#">
 
    <table width="600" border="0" align="center" cellpadding="1" cellspacing="1">
        <tr>
  <th colspan="2" scope="col" class="Header" align="center">Home Show Sign Up Form</th>
        </tr>

  <tr>
  <th align="left" class="red">Shifts</th>
    <td><select name="ShiftsList">
          <option value="" selected>  ... select a Shift</option>
      <cfloop query="ShiftsList">
        <option value="#ShiftsList.ShiftDetails#">#ShiftsList.ShiftDetails#</option>
      </cfloop>
    </select>
    </td>
  </tr>
     
  <tr>
  <td colspan="2" align="center"><input type="submit" NAME="SubmitForm"  value="Submit"></td>
  </tr>
    </table>
  </form>
</cfoutput>


 


ActionPage

-------------------

<cfquerydatasource="HomeShow"  name="InsertHomeShow">
INSERT INTO HomeShow
  VALUES
  ('#Form.USERID#',
  '#Form.Fname#',
  '#Form.Lname#',
  '#Form.Year#'
  ?

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. 


              )
</cfquery>

 

 

sofia.png


Viewing all articles
Browse latest Browse all 5794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>