Show/Hide tables

D

Dev880

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";
%//>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,087
Latest member
JeremyMedl

Latest Threads

Top