Open the [age in window in javascript

Posted on 2011-10-14
Last Modified: 2012-05-18
  How can I open the page in window when I do document.form.submit(); I have below code. when I do the submit using button, it is working fine, but when I hit is opening in a new webpage not in window.
I have the below code when hit enter

if (keycode == 13) {
            return false;

please let  me know how can I open in a new window with the properties specified in onSubmit.

Thank you

<form name="loginform" method="post" action="loginbean.jsp" target="login"  onsubmit="'', 'login', 'width=screen.availWidth-15,height=screen.availHeight-40,left=0,top=0,resizable=yes,scrollbars=yes')">

Open in new window

Question by:Sthokala
    LVL 2

    Accepted Solution

    try adding the id property to the form:

    you can use this syntax to submit the form from javascript:

    make sure you are capturing the enter key correctly - I've used JQuery hotkeys package with great success:

    Author Comment

    Thank you for your reply. I still see the page with the tool bars. Please see the below 2 images. When I click enter, I see the tool bars, but when I click on the button, it doesn't show tool bars. Please let me know how can I solve this.

    Thank you

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Javascript: Crash Course

    Javascript is not only emerging as the most important language to know, it's flexibility is unique. With Javascript being deployed on the web, mobile and even the desktop this is the one language that all technologists need to know.

    Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
    In Part 1 ( we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now