Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    india
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts

    opening a new window on clicking a link

    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.
    phani

  • #2
    Regular Coder
    Join Date
    Nov 2002
    Posts
    596
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>

  • #3
    New Coder
    Join Date
    Aug 2002
    Location
    india
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank u, it worked fine.

    regards
    phani.
    phani


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •