...

View Full Version : opening a new window on clicking a link



phani
04-01-2003, 02:09 AM
Hi,

I have a problem in opening a page in the new window on clicking on a link. Here iam having some hidden objects which i want to read it in the jsp file, so iam calling a javascript function where iam submitting the form which is coming well but the resultant file is not opening in a new window. How can i do it. Here is the sample code:

javascript:
function view()
{

document.forms[0].action="Viewdetails.jsp";
document.forms[0].submit();
}

Here is the link:
< a href="javascript:view()" target="_new">view</a>


thanks in advance
phani.

cheesebagpipe
04-01-2003, 02:14 AM
You need to TARGET the form submission - not the link:

function view()
{
var f = document.forms[0];
f.action="Viewdetails.jsp";
f.target = '_blank';
f.submit();
}

Here is the link:
<a href="javascript&#58;void view()">view</a>

phani
04-01-2003, 03:03 AM
thank u, it worked fine.

regards
phani.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum