Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

"not to show again " on popup window

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can i perform the following effect in java spring maven project. front end is using jsp.

first, user go to login page to input ID and password and click the LOGIN button to home page (home.jsp)
in the home.jsp page, it will prompt a pop up message (dim background) with close button on that message. once the user click the close button on popup message. it can browse the home page.

but i will bother the user it will prompt a popup message on every login. how can i prepare a checkbox on the popup message "not to show again" checkbox for the user profile. when the user "Tick" the checkbox and click close button, how can i set the value for that user profile?

can i use json to check backend program to save into database when user click checkbox and close button on popup message ?
any example? any code for reference?
 
Saloon Keeper
Posts: 12251
259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you need to keep track of whether the user dismissed the pop-up, you either need to add a column to the table of users in the DB, or add another table for the pop-up.

Since the pop-up is only shown once when the user logs in, you can process the "pop-up dismissed" data on the server before the home page is served, and then just add the necessary pop-up script to the HTML that is served.

You can also do it with an AJAX request, but it's not necessary.
 
lo hailey
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Since you need to keep track of whether the user dismissed the pop-up, you either need to add a column to the table of users in the DB, or add another table for the pop-up.

Since the pop-up is only shown once when the user logs in, you can process the "pop-up dismissed" data on the server before the home page is served, and then just add the necessary pop-up script to the HTML that is served.

You can also do it with an AJAX request, but it's not necessary.



yes. you are right. but how can i save the checkbox value when user click "close" button on the popup window.? how to call server side program when click "close" button.
now i am using javascript to hidden the "DIV" element in jsp.

any sample code for reference.
 
Ranch Hand
Posts: 92
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nice example here:

don't show example
 
look! it's a bird! it's a plane! It's .... a teeny tiny ad
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic