By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,863 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

Open Window with %

P: 1
Hi,

I am trying to open one new window with some values.

The following is my code ..

<%@ page import="java.util.*" %>
<%@ page contentType="text/html; charset=x-SJIS" %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT LANGUAGE=javascript>
function openwindow1(){
strURL="test.jsp?value1=welcome&value2=25&value3=2 00";
handle=window.open(strURL,'test1','top=1,left=1,re sizable=No, width=770,height=690');
}
function openwindow2(){
strURL="test.jsp?value1=welcome%&value2=25&value3= 200";
handle=window.open(strURL,'test2','top=1,left=1,re sizable=No, width=770,height=690');
}
</SCRIPT>
</HEAD>
<BODY>
<FORM action="" method=POST id=form1 name=form1 >
<%
System.out.println("****************************** ***********");
System.out.println("[Value - value1] :: " + request.getParameter("value1"));
%>
<input type='button' value='test1' onclick='openwindow1()'>
<input type='button' value='test2' onclick='openwindow2()'>
</FORM>
<P>&nbsp;</P>
</BODY>
</HTML>

If I click on test1 button, value is coming correctly, but when I am clicking on second button, the value is not coming. null value is coming.
I am not getting, this is Java script problem or jsp problem.

Please check the same and get back to me, why I am getting like that output for changing the js value.
Jan 5 '07 #1
Share this Question
Share on Google+
1 Reply


b1randon
Expert 100+
P: 171
Hi,

I am trying to open one new window with some values.

The following is my code ..

<%@ page import="java.util.*" %>
<%@ page contentType="text/html; charset=x-SJIS" %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT LANGUAGE=javascript>
function openwindow1(){
strURL="test.jsp?value1=welcome&value2=25&value3=2 00";
handle=window.open(strURL,'test1','top=1,left=1,re sizable=No, width=770,height=690');
}
function openwindow2(){
strURL="test.jsp?value1=welcome%&value2=25&value3= 200";
handle=window.open(strURL,'test2','top=1,left=1,re sizable=No, width=770,height=690');
}
</SCRIPT>
</HEAD>
<BODY>
<FORM action="" method=POST id=form1 name=form1 >
<%
System.out.println("****************************** ***********");
System.out.println("[Value - value1] :: " + request.getParameter("value1"));
%>
<input type='button' value='test1' onclick='openwindow1()'>
<input type='button' value='test2' onclick='openwindow2()'>
</FORM>
<P>&nbsp;</P>
</BODY>
</HTML>

If I click on test1 button, value is coming correctly, but when I am clicking on second button, the value is not coming. null value is coming.
I am not getting, this is Java script problem or jsp problem.

Please check the same and get back to me, why I am getting like that output for changing the js value.
Please paste the HTML/JS source not the JSP source. I can tell you if your JS is wrong when values are filled in, but I don't know what your JSP is going to fill in those blanks. You might even just see your problem in the HTML source. Give it a go.
Jan 5 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.