I just tried this for you. The following is the html and servlet code for your perusal. I think it meets your requirement(opens servlet in a new window)
HTML Code
----------
<HTML>
<HEAD>
<TITLE>
TESTING</TITLE>
</HEAD>
<BODY bgcolor=white>
<FORM name="Form" onSubmit="return func();" >
<center><b>
ID Number:�<input type="text" name="Userid" value="Ajan" SIZE=20 MAXLENGTH=9 ><br>
Password���:�<input type="password" name="Password" value="ferrari" SIZE=20><br>
</B></center>
<h1 align=right>
<input type="submit" value="Done">
<input type="Reset" value="Cancel">
</h1>
</FORM>
<Script language="JavaScript" >
function func()
{
var var1 = Form.Userid.value;
var var2 = Form.Password.value;
var var3 = "http://localhost:8080/servlet/PostServlet?Userid="+ var1 +"&Password="+ var2;
window.open(var3, "hello");
return true ;
}
</script>
</BODY>
</HTML>
Servlet Code
------------
import java.io.IOException;
import java.io.*;
import java.util.Properties;
import javax.servlet.*;
import javax.servlet.http.*;
public class PostServlet extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException,ServletException
{
doPost(request,response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException,ServletException
{
String userId = request.getParameter("Userid");
String password = request.getParameter("Password");
PrintWriter out = response.getWriter();
out.println(userId);
out.println(password);
}
}
Hope this helps
Ajan
[This message has been edited by Ajan Balakrishnan (edited February 01, 2001).]
[This message has been edited by Ajan Balakrishnan (edited February 01, 2001).]