<% Dim Recordset1 Dim Recordset1_numRows Set Recordset1 = Server.CreateObject("ADODB.Recordset") Recordset1.ActiveConnection = MM_checkbox_STRING Recordset1.Source = "SELECT * FROM tblcheck" Recordset1.CursorType = 0 Recordset1.CursorLocation = 2 Recordset1.LockType = 1 Recordset1.Open() Recordset1_numRows = 0 %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = 10 Repeat1__index = 0 Recordset1_numRows = Recordset1_numRows + Repeat1__numRows %> New Page 1
<% While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) %>
 <%=(Recordset1.Fields.Item("rsProduct").Value)%>
<% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 Recordset1.MoveNext() Wend %> <% itemList = "0" if Request.QueryString("cbName") <> "" then itemList = Request.QueryString("cbName") End If %>

<% Recordset1.Close() Set Recordset1 = Nothing %> Page 2 <%@LANGUAGE="VBSCRIPT"%> <% Dim Recordset1 Dim Recordset1_numRows Set Recordset1 = Server.CreateObject("ADODB.Recordset") Recordset1.ActiveConnection = MM_checkbox_STRING Recordset1.Source = "SELECT * FROM tblcheck WHERE itemID IN (" & itemList & ")" Recordset1.CursorType = 0 Recordset1.CursorLocation = 2 Recordset1.LockType = 1 Recordset1.Open() Recordset1_numRows = 0 %> [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Usergroup User webforumsuser@macromedia.com [ip] => "Usergroup User [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 7 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> pass dynamic checkbox values to results page? - HTML & CSS

pass dynamic checkbox values to results page? - HTML & CSS

ASP VB Access db Help! I'm trying to pass the results of dynamic checkboxes to a results pages. What's the easiest way to get this accomplished? This is what I have so far. [url]http://www.syspro.com/checkbox2.asp[/url] Referring URLs [url]http://www.syspro.com/checkbox2.asp[/url]...

  1. #1

    Default pass dynamic checkbox values to results page?

    ASP VB
    Access db

    Help! I'm trying to pass the results of dynamic checkboxes to a results pages. What's the easiest way to get this accomplished?

    This is what I have so far. [url]http://www.syspro.com/checkbox2.asp[/url]



    Referring URLs
    [url]http://www.syspro.com/checkbox2.asp[/url]




    Usergroup User webforumsuser@macromedia.com Guest

  2. #2

    Default Re: pass dynamic checkbox values to results page?

    "Usergroup User" [email]webforumsusermacromedia.com[/email] wrote:
    > ASP VB
    > Access db
    >
    > Help! I'm trying to pass the results of dynamic checkboxes to a results pages. What's the easiest way to get this accomplished?
    >
    > This is what I have so far. [url]http://www.syspro.com/checkbox2.asp[/url]
    What do you want to happen on the destination page?

    Right now you have the values of the checked boxes in the query string
    so you can grab them out of that easily enough:

    <%= Request.QueryString("checkboxname") %>

    Also, you should probably be giving each chckbox it's own name for the
    above to work well.

    Or do you need somethign else?

    --
    Enjoy,
    Danilo Celic
    | Extending Knowledge Daily
    | [url]http://www.CommunityMX.com/[/url]

    danilocelic Guest

  3. #3

    Default Re: pass dynamic checkbox values to results page?

    Danilo, thanks for the reply. On my destination page I would like to compare the check box selections from the previous page. My objective is to get a page similar to this (Comparison on the right side).

    [url]http://www.pricetool.com/ensw-Enterprise_Applications-All-ERP#more_options[/url]

    Does this help in know what I might need to do??

    Thanks.



    Referring URLs
    [url]http://www.pricetool.com/ensw-Enterprise_Applications-All-ERP#more_options[/url]




    Usergroup User webforumsuser@macromedia.com Guest

  4. #4

    Default Re: pass dynamic checkbox values to results page?

    "Usergroup User" [email]webforumsusermacromedia.com[/email] wrote:
    > Danilo, thanks for the reply. On my destination page I would like to compare the check box selections from the previous page. My objective is to get a page similar to this (Comparison on the right side).
    >
    > [url]http://www.pricetool.com/ensw-Enterprise_Applications-All-ERP#more_options[/url]
    >
    > Does this help in know what I might need to do??
    I think I see what you mean. You want the visitor to check some boxes
    and then filter the results on the next page based upon what they
    selected, correct?

    If so, in your checkbox page anme all your checkboxes the same, then in
    the page that is being submitted to add this code like this:

    itemList = "0"
    if Request.QueryString("cbName") <> "" then
    itemList = Request.QueryString("cbName")
    End If


    then create the recordset pulling from the proper table, do not add a
    filter.

    then go into the code, and change your SQL statement to something like this:
    "SELECT * FROM yourTable WHERE itemID IN (" & itemList & ")"

    Notice the IN ( ) part. That tells the db to grab all of the items from
    your table where the itemID is in the list of ids that should be in
    itemList.


    --
    Enjoy,
    Danilo Celic

    | Extending Knowledge, Daily
    | [url]http://www.CommunityMX.com/[/url]

    danilocelic Guest

  5. #5

    Default Re: pass dynamic checkbox values to results page?

    Thanks again for you assistance. Could you tell me what I'm doing wrong? This is the error message I"m getting on the "results.asp" page. I'm a little new to ASP so any insight is GREATLY appreciated.

    Microsoft JET Database Engine error '80040e14'

    Syntax error (missing operator) in query expression 'itemID IN ()'.

    /checkbox_results.asp, line 13




    Usergroup User webforumsuser@macromedia.com Guest

  6. #6

    Default Re: pass dynamic checkbox values to results page?

    "Usergroup User" [email]webforumsusermacromedia.com[/email] wrote:
    > Thanks again for you assistance. Could you tell me what I'm doing wrong? This is the error message I"m getting on the "results.asp" page. I'm a little new to ASP so any insight is GREATLY appreciated.
    >
    > Microsoft JET Database Engine error '80040e14'
    >
    > Syntax error (missing operator) in query expression 'itemID IN ()'.
    >
    > /checkbox_results.asp, line 13
    NOt without seeing your code.


    --
    Enjoy,
    Danilo Celic

    | Extending Knowledge, Daily
    | [url]http://www.CommunityMX.com/[/url]

    danilocelic Guest

  7. #7

    Default Re: pass dynamic checkbox values to results page?

    Thanks.

    Page 1

    <!--#include file="Connections/checkbox.asp" -->
    <%
    Dim Recordset1
    Dim Recordset1_numRows

    Set Recordset1 = Server.CreateObject("ADODB.Recordset")
    Recordset1.ActiveConnection = MM_checkbox_STRING
    Recordset1.Source = "SELECT * FROM tblcheck"
    Recordset1.CursorType = 0
    Recordset1.CursorLocation = 2
    Recordset1.LockType = 1
    Recordset1.Open()

    Recordset1_numRows = 0
    %>
    <%
    Dim Repeat1__numRows
    Dim Repeat1__index

    Repeat1__numRows = 10
    Repeat1__index = 0
    Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
    %>
    <html>

    <head>
    <meta http-equiv="Content-Type" content="text/html; cht=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Doent">
    <title>New Page 1</title>
    </head>

    <body>

    <form method="get" action="checkbox_results.asp">
    <%
    While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
    %>
    <table width="81%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td width="3%" height="19"><input name="cbName" type="checkbox" id="cbName" value="True"></td>
    <td width="97%"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<%=(Recordset1.Fields.Item("rsProduct ").Value)%></font></td>
    </tr>
    </table>
    <%
    Repeat1__index=Repeat1__index+1
    Repeat1__numRows=Repeat1__numRows-1
    Recordset1.MoveNext()
    Wend
    %>
    <%
    itemList = "0"
    if Request.QueryString("cbName") <> "" then
    itemList = Request.QueryString("cbName")
    End If
    %>
    <input type="submit" value="Submit" name="B1"></p>
    </form>

    </body>

    </html>
    <%
    Recordset1.Close()
    Set Recordset1 = Nothing
    %>



    Page 2

    <%LANGUAGE="VBSCRIPT"%>
    <!--#include file="Connections/checkbox.asp" -->
    <%
    Dim Recordset1
    Dim Recordset1_numRows

    Set Recordset1 = Server.CreateObject("ADODB.Recordset")
    Recordset1.ActiveConnection = MM_checkbox_STRING
    Recordset1.Source = "SELECT * FROM tblcheck WHERE itemID IN (" & itemList & ")"
    Recordset1.CursorType = 0
    Recordset1.CursorLocation = 2
    Recordset1.LockType = 1
    Recordset1.Open()

    Recordset1_numRows = 0
    %>



    Usergroup User webforumsuser@macromedia.com Guest

  8. #8

    Default Re: pass dynamic checkbox values to results page?

    "Usergroup User" [email]webforumsusermacromedia.com[/email] wrote:
    > Thanks.
    >
    Been out of town....


    I suggested that this code:
    *****
    itemList = "0"
    if Request.QueryString("cbName") <> "" then
    itemList = Request.QueryString("cbName")
    End If
    *****
    be placed into the page that the form is being submitted to, you have it
    in the page with the form on it. Place the above code into page 2 and
    make sure that it is placed above the code for the recordset.

    HTH



    --
    Enjoy,
    Danilo Celic

    | Extending Knowledge, Daily
    | [url]http://www.CommunityMX.com/[/url]

    danilocelic Guest

  9. #9

    Default Re: pass dynamic checkbox values to results page?

    Danilo,

    Welcome back. Thanks again for the input but unfortunately for me I can't seem to get this going. I'm not too familiar with ASP coding and for some reason I'm having a total mind block on this simple task. Could I impose of you to create a simple mockup for me so I may see your code? I do appreciate all your efforts.

    Thanks,
    Mark



    Usergroup User webforumsuser@macromedia.com Guest

Similar Threads

  1. Reading Dynamic Checkbox values
    By ldonner in forum Coldfusion - Advanced Techniques
    Replies: 8
    Last Post: July 5th, 10:51 AM
  2. url pass values
    By Χήρας Ανάργυρος in forum PHP Development
    Replies: 1
    Last Post: January 2nd, 11:15 AM
  3. [PHP] Cannot pass values from one page to another
    By Jay Blanchard in forum PHP Development
    Replies: 8
    Last Post: August 27th, 06:53 PM
  4. Pass Values to another page.
    By Martin Tully in forum ASP.NET General
    Replies: 2
    Last Post: July 24th, 03:52 PM
  5. Dynamic operator used in a search/results page
    By Elliott in forum Macromedia Dreamweaver
    Replies: 3
    Last Post: July 14th, 04:03 PM

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
  •