#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2011
    Posts
    2
    Rep Power
    0

    Help with dropdown


    I have a dropdown that I can not get the "selected" to work from pulling the info from the database. Everything works 100% except that...I have tested and verified all the variables and pulling all info from database... I just cannot get the selected tag to work... what is wrong??
    Thanks ahead of time.

    Code:
                    <% 
    While ((Repeat3__numRows <> 0) AND (NOT rsFOOD.EOF)) 
    %>
                      <%
    Dim subtotal
    subtotal=FormatNumber(rsFOOD("ITEMPrice"),2)*FormatNumber(rsFOOD("ITEMQuantity"),2)%>
                      <form action="?add=edititem&INVNumber=<%=rsINV("INVNumber")%>&INVID=<%=rsINV("INVID")%>&ITEMID=<%=rsFOOD("ITEMID")%>" method="post" id="form<%=rsFOOD("ITEMID")%>">
                        <%If (Repeat3__numRows Mod 2) Then%>
                        <tr bgcolor="#FFFFFF"> 
                          <%Else%> 
                          <tr bgcolor="#E6E6E6"> 
                            <%End If%>
                            <td class="item_header"><%=rsFOOD("ITEMName")%></td>
                            <td class="action_view">&nbsp;</td>
                            <td class="action_view">&nbsp;</td>
                            <td class="action_view">&nbsp;</td>
                            <td class="action_view"><input type="submit" name="Submit3" id="Submit3" value="Add/Edit" <%If (Repeat3__numRows Mod 2) Then%>class="button_even"<%Else%>class="button_odd"<%End If%> /></td>
                            </tr>
                        <%If (Repeat3__numRows Mod 2) Then%>
                        <tr bgcolor="#FFFFFF"> 
                          <%Else%> 
                          <tr bgcolor="#E6E6E6"> 
                            <%End If%>
                            <td class="action_view"><select name="INVItem<%=rsFOOD("ITEMID")%>" id="INVItem<%=rsFOOD("ITEMID")%>">
                              <% Do While Not rsFOOD2.EOF%>
                              <% Dim SelectValue
    					 SelectValue=rsFOOD("ITEMINVID")
    					 %>
                              <option value="<%=rsFOOD2("FOODID")%>" <%If rsFOOD2("FOODID")=SelectValue Then%> selected = "<%=SelectValue%>"<%End If%>><%=rsFOOD2("FOODName")%></option>
                              <%rsFOOD2.MoveNext%>
                              <%Loop%>
                              <%rsFOOD2.Requery%>
                              </select></td>
                            <td class="action_view"><input name="INVQuantity<%=rsFOOD("ITEMID")%>" type="text" id="INVQuantity<%=rsFOOD("ITEMID")%>" value="<%=rsFOOD("ITEMQuantity")%>" size="5" /></td>
                            <td class="action_view"><%=subtotal%></td>
                            <td class="action_view"><input name="INVInstructions<%=rsFOOD("ITEMID")%>" type="text" id="INVInstructions<%=rsFOOD("ITEMID")%>" value="<%=rsFOOD("ITEMInstructions")%>" size="30" /></td>
                            <td class="action_view"><input type="submit" name="Delete" id="Delete" value="Delete" <%If (Repeat3__numRows Mod 2) Then%>class="button_even"<%Else%>class="button_odd"<%End If%> /></td>
                            </tr>
                        </form>                  
                      <% 
      Repeat3__index=Repeat3__index+1
      Repeat3__numRows=Repeat3__numRows-1
      rsFOOD.MoveNext()
    Wend
    %>
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2011
    Posts
    2
    Rep Power
    0

    Fixed it


    I fixed it, it was a database issue between a text field and an integer!
  4. #3
  5. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,439
    Rep Power
    4539
    I'm glad you got it sorted out.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester

IMN logo majestic logo threadwatch logo seochat tools logo