Avatar of Rohit Bajaj
Rohit BajajFlag for India

asked on 

Creating a dialog box with buttons on a web page

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 :
User generated imageI 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
JavaScriptWeb DevelopmentjQuery

Avatar of undefined
Last Comment
Mukesh Yadav
ASKER CERTIFIED SOLUTION
Avatar of Mukesh Yadav
Mukesh Yadav
Flag of India image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of Paweł
Paweł
Flag of Switzerland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Rohit Bajaj
Rohit Bajaj
Flag of India image

ASKER

Is jquery UI installable while npm ?
Avatar of Rohit Bajaj
Rohit Bajaj
Flag of India image

ASKER

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.
Avatar of Paweł
Paweł
Flag of Switzerland image

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
Avatar of Mukesh Yadav
Mukesh Yadav
Flag of India image

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
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo