Need suggestion!

Now i created a popup windows with HTML based on the main page, there is an input text area and a search button in the popup window, after i click the search button, i need to execute some jsp code to take data from backend and display the result on the same popup windows, is there somebody can help me doing that? following is my basic source code, but it doesn't work.

<--Code-->

<html>

<%@ page import="java.util.*, java.rmi.*" %>

<title>Stock Symbol Lookup</title>

<head></head>

<body>

<%

Collection collection = new ArrayList();

%>

<FORM>

<table cellspacing="0" cellpadding="0" >

<tr valign="middle" align="center" width="90" height="35" bgcolor="#c0c0c0"><a style="color:#000000;font-weight:bold;"><font size="4">Stock Symbol Lookup</font></a></tr>

</table>

<tr>

<td><font size="3" color="#000000">Enter a Company Name: </font>

<INPUT TYPE="Text" name="lookUpId" value=""></td>

<td><INPUT TYPE="button" value="Look it up!"

onclick = "javascript:

<%

//todo, look up data from the backend.

%>">

</td>

</tr>

</FORM>

<%

if(collection.size() > 0)

out.println("the size of collectiion is" + collection.size());

%>

</body>

</html>

[1545 byte] By [wagj707] at [2007-9-26 2:47:04]
# 1

1.in the parent html page, suppose you have a button:

<td>

<input type="button" name="nextPg" value="NEXT" onclick="NewWindowsPopup()">

</td>

or, anything can used in the script function, such as onmouseOver, onchange..

-

function NewWindowsPopup() {

var w=480, h=340;

if (document.all || document.layers) {

w = screen.availWidth;

h = screen.availHeight;

}

var popW = 300, popH = 200;

var topPos = (w-popW)/2, leftPos = (h-popH)/2;

window.open('../folder/newpage.html','popup','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos + ',resizable=yes');

}

-

3.in the newpage.html page, you have another button "look up" to call another function

function lookup {

String[] resultset;

// it can be static or dynamic from database

for (i =0; i < resultset.length; i++) {

obj_msel.options[obj_msel.options.options.length]= new Option(resultset);

// obj_msel is the form object name

//options is the select object

// in your popup window, you need have document element have a object name.

}

}

yaying at 2007-6-29 10:31:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...