Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 18 of 18

Thread: pop up window when click submitform

  1. #1
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default pop up window when click submitform

    how can i custom a popup window in js when i click the submit button.
    the popup window only has a "Confirm" button, and how to detect user has clicked the button, then it can return the submit form?




    P.S. the popup window doesn't allow to ajust size, and hidden the the top toolbar (so user can't click the close popup window button at right top corner)

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: pop up window when click submitform

    Can you post the code for what you are talking about?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: pop up window when click submitform

    I want to pop up a window in the form submit javascript, and it return once pop up window closes. the pop up can be closed by clicking close button. any code for my reference.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: pop up window when click submitform

    Javascript is not the same as Java.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how can I popup window when i first time logon

    how can i display a popup window only when i first time visit the page after logon. it will not prompt after re-visit the page after logon.

    my popup code is as below, but it will popup window every time when i refresh/re-visit the page.
    <body>
    <style>
    .modal {
    display: block;
    position: fixed;
    z-index: 999;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
    }
    </style>
    <div id="Dialog" class="modal" tabindex="-1" />
    Last edited by -_-"; June 23rd, 2020 at 09:19 AM.

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: how can I popup window when i first time logon

    Doesn't look like java code.
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: how can I popup window when i first time logon

    it is jsp, the server side is java

    I don't know how to implement to detect first time loading after logon

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: how can I popup window when i first time logon

    Sorry, I don't know js. I do not see any java code in what was posted.
    If you don't understand my answer, don't ignore it, ask a question.

  9. #9
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how to detect first time loading after logon, then popup window when first time loading

    how can i display a popup window only when i first time visit the page after logon. it will not prompt after re-visit the page after logon.

    my popup code is as below, but it will popup window every time when i refresh/re-visit the page.
    <body>
    <style>
    .modal {
    display: block;
    position: fixed;
    z-index: 999;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
    }
    </style>
    <div id="Dialog" class="modal" tabindex="-1" />

  10. #10
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: how can I popup window when i first time logon

    how to write the code in page_load in java? how to know which java page_load?
    my project is mavan project and Spring.

  11. #11
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: how can I popup window when i first time logon

    Can you post the java code you are trying to change?
    If you don't understand my answer, don't ignore it, ask a question.

  12. #12
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: how can I popup window when i first time logon

    i have not start writing the program i don't have concept...so seeking for help here.
    do you have sample coding for reference.
    i just know when the page is loaded, then it includes js file , jsp, java...it uses XMLHttpRequest
    Last edited by -_-"; June 23rd, 2020 at 10:31 AM.

  13. #13
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: how can I popup window when i first time logon

    Sorry, I do not have any js or jsp code.
    If you don't understand my answer, don't ignore it, ask a question.

  14. #14
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: how can I popup window when i first time logon

    any other people know that requirements and can advice how to develop the program java jsp program

    --- Update ---

    how can I write java program in jsp to check the previous page name, if previous page name =logon.jsp , then show the pop up window, else hide the popup window to enhance my coding I provided in the first post.

  15. #15
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: how can I popup window when i first time logon

    Can you post your current java code?
    If you don't understand my answer, don't ignore it, ask a question.

  16. #16
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: how can I popup window when i first time logon

    Quote Originally Posted by Norm View Post
    Can you post your current java code?
    i have not started writing the java program, i only have the jsp to popup window. but it seems everytime when user visit the page, it will prompts popup window. now i want to add control in java or jsp to control it will only prompt once.

    my code is as below.
    <body>
    <style>
    .modal {
    display: block;
    position: fixed;
    z-index: 999;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
    }
    </style>
    <div id="Dialog" class="modal" tabindex="-1" >
    <div id="Content" > <button id="Closebtn" onClick="Dialog.hide()" value="Close"/>
    </div>

  17. #17
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: how can I popup window when i first time logon

    A way to only do something only once in a program is to have a flag that tells you if the event has happened. Default to false and set it true the first time the event happens. Test if true and don't do whatever if it is true.

    Why post non-java code?
    If you don't understand my answer, don't ignore it, ask a question.

  18. #18
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: how can I popup window when i first time logon

    it is part of the java project, for java project in eclipse, it is composed with many type of file , e.g. .properties file is for configuration. front-end file and backend file (java), so is it stricted to java program only, for other, is it not related to java can't discuss/resolve here ?

Similar Threads

  1. Applet viewer window is diplaying in fron of the current window every time
    By jsreddy99 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 24th, 2013, 07:16 AM
  2. Replies: 2
    Last Post: August 27th, 2012, 09:19 PM
  3. Replies: 1
    Last Post: December 17th, 2011, 03:32 AM
  4. Craating non active window ,and inputing to the non active window.
    By java-beginner in forum Java Theory & Questions
    Replies: 0
    Last Post: February 25th, 2011, 10:13 PM