This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes passing values to a pop up window (SOS) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "passing values to a pop up window (SOS)" Watch "passing values to a pop up window (SOS)" New topic
Author

passing values to a pop up window (SOS)

amit malhotra
Ranch Hand

Joined: Aug 06, 2001
Posts: 30
hello friends,
here is a little problem that i have please see if you can fix it
<html>
<head>
<title>Project Life Cycle</title>
<script>
function buttonEvents(){
document.forms[0].action="success.jsp";
document.forms[0].submit()
}

function buttonEvents1(){
document.forms[0].action="querycontent.jsp";
document.forms[0].submit()
}

function openWindow(){
open("path.jsp'","sayings","menubar=0,scrollbar=0, resizable=0, width=250,height=250,top=150, left=400")
}
</script>
</head>
<%@ page import="java.sql.*" %>

<body style="font-family: Verdana; font-size: 10pt; color: #000080" background="BACKGROUND1.jpg">
<table border="0" width="780" cellspacing="0" cellpadding="0" height="68">
<tr>
<td width="100%" height="68">
<table border="0" width="100%" height="75" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" background="HEADER1.jpg" height="69"> </td>
</tr>
</table>


<h3 align="center" >Project Life Cycle</h3>
<form name="feedbackform" method="post">
<div align="center">
<table border="1" width="650" style="font-family: Verdana; font-size: 10pt>


<tr>
<td align="center" ><b></b></td>
<td align="center" ><b>PID's</b></td>
<td align="center" nowrap><b>Equip List</td>
<td align="center" nowrap><b>Line List</td>
<td align="center" nowrap><b>Inst List</td>
</tr>
<%
String tableselected;
String driver="sun.jdbc.odbc.JdbcOdbcDriver";
String protocol="jdbc dbc:db2";
//Connection conn = null;
//Statement stmt = null;
ResultSet rs = null;
String sqlquery ="SELECT * FROM crude ";
Class.forName(driver);
Connection conn=DriverManager.getConnection(protocol);
Statement stmt = conn.createStatement();
rs = stmt.executeQuery(sqlquery);

while(rs.next()){
String PID_PATH = rs.getString(1);
String PID_311 = rs.getString(2);


%>
<tr>
<td align="center" width="50%">
<input type="submit" name="pid" value="<%= PID_311 %>" onClick="openWindow()"></td>
<td align="center"><input type="checkbox" name="amit" value="<%= PID_311 %>"></td>
<td align="center"><input type="checkbox" name="amit" value="<%= PID_311 %>"></td>
<td align="center"><input type="checkbox" name="amit" value="<%= PID_311 %>"></td>
</tr>
<%
}
%>
<tr>
<td> </td>
<td align="center"><input type="submit" value="Status" name="B1"onClick ="buttonEvents()">    <input type="submit" value="Doc" onClick ="buttonEvents1()"></td>
<td align="center"><input type="submit" value="Status" name="B2">    <input type="submit" value="Doc"></td>
<td align="center"><input type="submit" value="Status" name="B3">    <input type="submit" value="Doc"></td>
</tr>
</TABLE>

</div>
</form>
</body>
</html>
in the function openWindow() i am opening a pop up window called
path.jsp, i want to pass a parameter to it say PID_PATH
how do i do it ,please tell me as i have tried all the options
thanx
sanj singh
Ranch Hand

Joined: Jun 30, 2001
Posts: 129
Hi Amit
Try this
window.open("yourjsppage.jsp?param1=value1¶m2=value2.....");
I have done it the same way but I wasn't very successful if I tried passing other parameters like scrollbar etc.
regards
sanj
amit malhotra
Ranch Hand

Joined: Aug 06, 2001
Posts: 30
Hello Sanjay,
i will try out the same hope it works out, I was trying to pass the param in the same way but was unsuccessful, will rey out again
 
 
subject: passing values to a pop up window (SOS)
 
Similar Threads
Error comes whilke compiling the jsp page
calling the struts action on jquery button click
stylesheet effect are not showing in jsp page
How to validate that in each row how many checkboxes are checked
how to delete the rows which are checked