Show/Hide tables

Discussion in 'Java' started by Dev880, Apr 7, 2004.

  1. Dev880

    Dev880 Guest

    Here is the code I am working with, I am unshure how to envoke the action I was using a form but would like to use javascript. However, I don't want issues if javascript is turned off or firewalls will block the code. I have done this is ASP but not shure how to deal with cookies and forms well enough in JSP. If there is an easier way please share.

    Basically I want to:

    1. Read the form data from cookie
    2. If form is null then show all, if not null hide TR

    1. If button is selected set cookie to other state
    2. Reload page to reflect new setting
    This is what I currently have in JSP

    <table>
    <tr>
    <td></td>
    </tr>

    <tr> <------------ Show or Hide
    <td></td>
    </tr> <------------- This table row data

    </table>



    --------------------------------------------------------------------------------


    <//%

    //Get form data
    String toggle = request.getParameter("toggle");
    if(toggle.equals("toggle")) {
    %//>

    <tr><td class='list' align='center' colspan="2">

    <//%

    ResultSet rs = stat.executeQuery(tableStr);
    while (rs.next()) {
    out.println(rs.getString(4) + "<br>" + rs.getString(2) + "&nbsp;" + rs.getString(3)+"<br>--------<br>");
    }
    rs.close();
    con.close();
    String toggle = "null" //

    %//>

    </td></tr>
    }
    toggle = "toggle";
    %//>
     
    Dev880, Apr 7, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Bassett
    Replies:
    3
    Views:
    950
    Augustus
    Aug 15, 2003
  2. Marek Mänd
    Replies:
    5
    Views:
    213
    Thomas 'PointedEars' Lahn
    Jun 27, 2004
  3. Zambien
    Replies:
    2
    Views:
    176
    Dr John Stockton
    Oct 2, 2004
  4. hide tables rows

    , Jan 23, 2007, in forum: Javascript
    Replies:
    5
    Views:
    120
  5. ll
    Replies:
    2
    Views:
    664
    Thomas 'PointedEars' Lahn
    May 1, 2008
Loading...

Share This Page