Form:
ActionPage
-------------------
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
Code:
<!-- 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>
-------------------
Code:
<cfquerydatasource="HomeShow" name="InsertHomeShow"> INSERT INTO HomeShow VALUES ('#Form.USERID#', '#Form.Fname#', '#Form.Lname#', '#Form.Year#' ?
Code:
) </cfquery>