troubleshooting Question

Bootstrap Modal and ASP QueryString, pt deux

Avatar of Bob Schneider
Bob SchneiderFlag for United States of America asked on
ASPJavaScriptBootstrap
4 Comments1 Solution17 ViewsLast Modified:
I got some great help on this site for creating a workable modal.  I have created a "processing.asp" page as instructed.  All works well except I can't connect the modal query string item_id to the modal form.  I believe it is supposed to be done here:
<a href="#editModal" class="button getItemData" data-toggle="modal" 
                                                    data-target="#editModal" data-itemID="<%=Items(0, i)%>"><%=Items(1, i)%></a>

Open in new window

 but I don't know how to pass that to here:
<div class="modal fade" id="editModal" tabindex="-1" aria-labelledby="editModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="editModalLabel">Edit Item</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            
            <form class="form-horizontal form-simple"  name="edit_item" method="Post" 
            action="items.asp?item_id=<%=lItemID%>">
            <div class="modal-body">
                <%
                lItemID = 6
                Set rs = Server.CreateObject("ADODB.Recordset")
                sql = "SELECT Item, Descr, MaxPts, MinPts, Active FROM Items WHERE eTRaXCID = " & Session("eTRaXC_ID")
                sql = sql & " AND ItemsID = " & lItemID
                rs.Open sql, conn, 1, 2
                If rs.RecordCount > 0 Then
                %>
                    <table class="table table-striped table-condensed table-sm">
                        <tr>
                            <th>Item Name:</th>
                            <td>
                                <input type="text" class="form-control" 
                                name="edit_item" id="edit_item" required="" value="<%= rs(0).Value%>">
                            </td>
                        </tr>
                        <tr>
                            <th>Descr:</th>
                            <td>
                                <textarea class="form-control" name="edit_descr" id="edit_descr" rows="3"
                                        required=""><%= rs(1).Value%></textarea>
                            </td>
                        </tr>
                        <tr>
                            <th>Max Pts:</th>
                            <td>
                                <select class="form-control" name="edit_max_pts" id="edit_max_pts" required="">
                                    <%For j = 0 to 10%>
                                        <%If CInt(j) = CInt(rs(2).Value) Then%>
                                            <option value="<%=j%>" selected><%=j%></option>
                                        <%Else%>
                                            <option value="<%=j%>"><%=j%></option>
                                        <%End If%>
                                    <%Next%>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <th>Min Pts:</th>
                            <td>
                                <select class="form-control" name="edit_min_pts" id="edit_min_pts" required="">
                                    <%For j = 0 to -10 Step -1%>
                                        <%If CInt(j) = CInt(rs(3).Value) Then%>
                                            <option value="<%=j%>" selected><%=j%></option>
                                        <%Else%>
                                            <option value="<%=j%>"><%=j%></option>
                                        <%End If%>
                                    <%Next%>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <th>Active:</th>
                            <td>
                                <select class="form-control" name="edit_active" id="edit_active" required="">
                                    <%If rs(4).Value = "y" Then%>
                                        <option value="y" selected>Yes</option>
                                        <option value="n">No</option>
                                    <%Else%>
                                        <option value="y">Yes</option>
                                        <option value="n" selected>No</option>
                                    <%End If%>
                                </select>
                            </td>
                        </tr>
                    </table>
                <%Else%>
                    <div class="row"><div class="col-sm-12">No Data</div></div>
                <%
                End If
                rs.Close
                Set rs = Nothing
                %>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button type="submit" class="btn btn-primary"name="submit_changes" id="submit_changes" value="submit_changes">Save Changes</button>
            </div>
            </form>
        </div>
    </div>




Open in new window

Note that this has the db query in the modal portion of the page rather than in a separate asp page.  I have the asp page ready...just trying to see how to pass the qs to it.  I am including a screen shot of how it looks on a mobile device.
ASKER CERTIFIED SOLUTION
Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 4 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 4 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004