SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Aug 2004
    Location
    Canada
    Posts
    730
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    2 questions is it possible to have different actions and how to send selected ones

    I have a dropdown which have different destinations. How can I send them?

    How do I send the Checked records only?

    If you want to see what I have :
    Code:
    <FORM ACTION="my_edit_links_action.asp" METHOD="post">
    <TABLE BORDER="1">
    
                      <table border="1" cellspacing="0" cellpadding="0" width="732" style="width:549.0pt;
     border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt;
     mso-padding-alt:0in 0in 0in 0in">
     <tr>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Select</font><br>
     <select size="1" name="choices" id="choices">
            <option SELECTED VALUE="">None</option> 
            <option VALUE="Delete Checked Rows" ACTION="my_edit_links_action.asp">Delete</option>
            <option VALUE="002" ACTION="emailto.asp">Email to:</option>
            <option VALUE="003">Print</option>
            <option VALUE="004">Save in:</option>
     </select><input type="submit" value="OK" name=submit><br>
    <input type='checkbox' onclick='checkAll(this.form,this)' value="check all" name="p_delete">
     <font face="Verdana" color="#FFFFFF">Select All</font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Book Title</font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Book #/<br>Book Spoke</font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Chapter #/<br>Chapter Spoke</font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Verse #/<br>Verse Spoke</font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Text</font></th>
      </tr>
    <%
    
        set rs = Server.CreateObject("ADODB.Connection")
        rs.Open "kjv"
    
        set tableSet = Server.CreateObject("ADODB.RecordSet")
        tableSet.Open "select * from results order by id", rs, adOpenForwardOnly, adLockOptimistic, adCmdText
    %>
    
    <%    while not tableSet.EOF
    %>  <tr>
    <td>
    <p><span><INPUT TYPE="checkbox" NAME="p_delete"
    VALUE="<%=tableSet("id")%>">
    <A HREF="my_edit_links_rec.asp?p_id=<%
                        Response.Write tableSet("id")%>"><%= tableSet.Fields(0).Value %></A>
          </span></p>
        </td>
        <td>
          <p><span><%=tableSet("book_title")%>
          </span>
          <td>
          <p><span><%=tableSet("book")%>
          </span></p>
        </td>
        <td>
          <p><span><%=tableSet("chapter")%>
          </span></p>
        </td>
           <td>
          <p><span><%=tableSet("verse")%>
          </span></p>
        </td>
        <td>
          <p><span><b><%=tableSet("book_title")%>&nbsp;&nbsp;<%=tableSet("chap")%>:<%=tableSet("vers")%></b><br><%=tableSet("text_data")%>
          </span></p>
        </td>
          </tr>
          <tr>
        <td></td><td></td><td>
          <p><span><%=tableSet("book_spoke")%>
          </span></p>
        </td>
        <td>
          <p><span><%=tableSet("chapter_spoke")%>
          </span></p>
        </td>
           <td>
          <p><span><%=tableSet("verse_spoke")%>
          </span></p>
    <%            for col = 1 to (p_numberofColumns-1)
    %>
                          <%= tableSet.fields(col).Value %>
          </span></p>
          </TD>
    <%            next  %>
                 </TR>
    <%        tableSet.MoveNext
        wend
        tableSet.Close
        set tableSet = Nothing
    %>
    
    </TABLE>
    
    </form>

  2. #2
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You need to have a redirection page that checks the value from the drop-down box and redirects the user accordingly:

    Code:
    <%
    action = request.form("choices")
    Select Case action
     Case "002"
      response.redirect "whatever1.asp"
     Case "003"
      response.redirect "whatever2.asp"
     Case "004"
      response.redirect "whatever3.asp"
     Case Else
      response.redirect "whatever4.asp"
    End Select
    %>

  3. #3
    SitePoint Guru
    Join Date
    Aug 2004
    Location
    Canada
    Posts
    730
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok thanks

  4. #4
    SitePoint Guru
    Join Date
    Aug 2004
    Location
    Canada
    Posts
    730
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    An array index is out of range. What does that mean?


    Request object error 'ASP 0105 : 80004005'

    Index out of range

    /kjvresp_action.asp, line 19

    An array index is out of range.
    19 is in bold:


    Code:
    <%@ LANGUAGE="VBSCRIPT" %>
    <%    Response.buffer = TRUE= true   %>
    <!--#include file="adovbs.inc"-->
    <!--#include file="isadmin.inc"-->
    <%
    if isAdmin then
        set outpostDB = Server.CreateObject("ADODB.Connection")
    Private Function GetConnectionString()
        GetConnectionString =   "Driver={Microsoft Access Driver (*.mdb)};" & _
                    "DBQ=" & Server.MapPath("kjv") & ";" & _
                    "UID=;PWD=;"
    End Function
        outpostDB = GetConnectionString()
        set deleteSet = Server.CreateObject("ADODB.RecordSet")
        deleteSet.Open "select * from results order by res_id", outpostDB, adOpenDynamic, adLockPessimistic, adCmdText
        p_thisDelete = 1
        while not deleteSet.EOF
            if cint(deleteSet("res_id")) = cint(Request.form("p_delete").item(p_thisDelete))  then
                deleteSet.Delete
                deleteSet.Update
                if p_thisDelete < Request.form("p_delete").Count then
                    p_thisDelete = p_thisDelete + 1
                end if
            end if
            deleteSet.MoveNext
        wend
        deleteSet.Close
        set deleteSet = Nothing
    
    
        set outpostDB = Nothing
    
        Response.Clear
        Response.Redirect "http://127.0.0.1/kjvresp.asp"
    else
    
        Response.Write "You do not have access to this page."
    
    end if
    %>
    </BODY>
    </HTML>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •