Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Show/Hide tables

Reply
Thread Tools

Show/Hide tables

 
 
Dev880
Guest
Posts: n/a
 
      04-07-2004
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";
%//>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get database metadata information (i.e. existing tables and columns in tables) Chris Brat Python 5 08-22-2006 05:25 PM
New AMD Turion 64 OPN & ID Tables Silverstrand Front Page News 0 09-05-2005 02:17 PM
Tables within tables Otuatail HTML 7 08-02-2004 04:42 AM
Problem printing tables hbmath Firefox 0 08-23-2003 10:35 PM
Text after 2 tables actually appears between 2 tables ! Peter Bassett HTML 3 08-15-2003 06:46 PM



Advertisments