1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Phase One: Collect underpants. Phase Three: Profit. Phase Two: ???

Discussion in 'Web Design & Development' started by drdrew1469, Feb 17, 2005.

Thread Status:
Not open for further replies.
Advertisement
  1. drdrew1469

    drdrew1469 Thread Starter

    Joined:
    Nov 30, 2000
    Messages:
    436
    Just like the underpants gnomes I'm missing Phase Two: Making it work. I have an html page with a form and a few radio buttons. Based on ALL the selected radio buttons I want to filter a csv database and display it in a dynamic table. Here's where I'm at with this: Phase One: Setup Radio Buttons and Form. Phase Three: Display csv database in dynamic table. Phase Two: pass radio button values to filter csv results...??? I'm guessing java, maybe I'm wrong, but would someone help me fill in the balnks here? I posted snips of code below so that names, values used would make sense to me.


    <input type="radio" value="A" name="R1">A
    <input type="radio" value="B" name="R1">B
    <input type="radio" value="All" checked name="R1">All Records
    <input type="radio" value="1" name="R2">1
    <input type="radio" value="2" name="R2">2
    <input type="radio" value="All" name="R2">All Records

    and then have the form pass the selected values to a popup window with the dynamic results:

    <table datasrc='#data' width=660 align=center>
    <thead align=left>
    <tr><th>Letter</th>
    <th>Number</th>
    </tr>
    </thead>
    <tbody><tr>
    <td><span datafld='R1'></span></td>
    <td><span datafld='R2'></span></td>
    </tbody>
    </table>
    <object ID=data classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">
    <param nAme="DataURL" value="data.csv">
    <param nAme="UseHeader" value="true">
    </object>

    thanks,

    drew
     
  2. TechGuy

    TechGuy Administrator

    Joined:
    Feb 12, 1999
    Messages:
    14,195
    First Name:
    Mike
  3. drdrew1469

    drdrew1469 Thread Starter

    Joined:
    Nov 30, 2000
    Messages:
    436
    Thanks for the link. I'm not writing TO the file, I'm just grabbing data FROM the file. The csv is a static file that doesn't change and won't be written to by anyone without ftp access (ie, administrator = me :) )

    thanks,

    drew
     
  4. drdrew1469

    drdrew1469 Thread Starter

    Joined:
    Nov 30, 2000
    Messages:
    436
    Update:

    I think I'm almost there, just missing something that seems very simple now. My html page now submits the radio button values to an asp page. So my question(s):

    1. do I put this is the header or body?

    gotthis = Request.form("R1")
    gotthat = Request.form("R2")

    2. when these values are now in my asp page, how can I use them in my object parameters, like variables? ex:

    <param name="Filter" value="(Column1 = "%R1%" & Column2 = "R2")">

    Whew! I hope it's obvious that I have been researching and trying to make this work and not wait for someone to do it for me! I'm new to asp though, so I'm not really sure what to do now. If I replace "%R1%" or "R2" with an actual value, my table works perfectly and I'm a happy boy. Now how to pass ga...err, param. :)

    thanks,

    drew
     
  5. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    You have a sample of your flat file I can look at. It is pretty simple once you make the connection to the text file and create your recordset.
     
  6. drdrew1469

    drdrew1469 Thread Starter

    Joined:
    Nov 30, 2000
    Messages:
    436
    Sure, I'm just using test data in a file called data.csv (I'm very simplistic :) )

    Column1,Column2
    A,1
    A,2
    A,2
    A,3
    B,1
    B,1
    B,2
    B,3
    B,3

    This way when my user submits that R1="A" and R2=* (all), my dynamic table will show all "A" records, and if they select R1=* (all) and R2="2", then all "2" records will be displayed regardless of Column1(R1). It works well hard-coded, but that defeats the purpose. :)

    thanks,

    drew
     
  7. drdrew1469

    drdrew1469 Thread Starter

    Joined:
    Nov 30, 2000
    Messages:
    436
    SOLVED!

    I finally figured it out. To recap my little adventure:
    1. Radio buttons in a form submitted to an asp page.
    2. Grab the variables from the submitted page and use them to filter a csv database.
    3. Display results in a dynamically generated table with sort features and images with hyperlinks.

    If anyone cares my problem was referencing the variables. I thought I had to DIM and pass, but it was easier than that. This in my OBJECT tag fixed my problem:

    <param name="Filter" value="(Column1 = <%=Request.form("R1")%> & Column2 = <%=Request.form("R2")%> & Column3 = <%=Request.form("R3")%> & Column4 = <%=Request.form("R4")%>)">

    thanks, for those who helped out,

    drew
     
  8. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/331640

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice