[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Creating a dialog box with buttons on a web page

Posted on 2016-07-28
6
Medium Priority
?
91 Views
Last Modified: 2016-08-13
Hi,
In my web application when a user clicks on close button i want a box to appear with following content :
Text : Changes you made will not be saved
Buttons :
1) Close
2) Don’t close

I tried using the window.confirm  It shows dialog like :
Screen-Shot-2016-07-29-at-12.13.59-P.pngI couldnt find how to change the names of the buttons.
Some places its mentioned that you cannot change it. What alternative ways are there ?

Thanks
0
Comment
Question by:Rohit Bajaj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 9

Accepted Solution

by:
Mukesh Yadav earned 1000 total points
ID: 41734223
Yes this is not possible to change these values.

To use something different you can go with Bootbox confirm method.
0
 
LVL 10

Assisted Solution

by:Paweł
Paweł earned 1000 total points
ID: 41734224
if you are using the front end just use the jquerUI modal dialog

https://jqueryui.com/dialog/#modal-confirmation, it'll be more work, but yes as far as i know you can't modify the buttons in a window.confirm, just like you cant change then button on the alert.
0
 

Author Comment

by:Rohit Bajaj
ID: 41734587
Is jquery UI installable while npm ?
0
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 

Author Comment

by:Rohit Bajaj
ID: 41734624
I tried using require("jquery-ui");
installed it using npm install jquery-ui.
But getting error on this line :     $("#dialog").dialog({ autoOpen: false });
TypeError: $(...).dialog is not a function
On this sample page : http://api.jqueryui.com/dialog/#entry-examples
They are using 3 jquery related libraries.
for jquery i am already using 2.1.4 version.
0
 
LVL 10

Expert Comment

by:Paweł
ID: 41734628
I don't think you've included jqueryUI correctly

https://www.npmjs.com/package/jquery-ui
https://forum.jquery.com/topic/how-can-i-install-jquery-ui-1-11-4-with-npm

i think you're going to have to download Jquery UI and add it manually.

I should also mention i'm not familiar with NPM
0
 
LVL 9

Expert Comment

by:Mukesh Yadav
ID: 41753787
Hi Rohit,

Can you please close this question by accepting a solution, If current answers doesn't work for you please tell us what issue  you are facing.

Thanks,
Mukesh Yadav
0

Featured Post

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses

656 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