By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,982 Members | 1,939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,982 IT Pros & Developers. It's quick & easy.

delete prompt box is not working

P: 6
Expand|Select|Wrap|Line Numbers
  1. "Delete" : function() {
  2.  
  3.                     var result = prompt("Want to delete?");
  4.                 if (result==true) {
  5.                     deleteUser(userId);
  6.             }
  7.  
  8.  
  9.                 },
May 18 '14 #1
Share this Question
Share on Google+
5 Replies


P: 94
I think the call to prompt should be:
Expand|Select|Wrap|Line Numbers
  1. var result = window.prompt( "Want to delete?" )
Also, anything the user enters that is not an empty string (or null, if that's possible to be entered) will be considered true.
May 18 '14 #2

Dormilich
Expert Mod 5K+
P: 8,639
hm, why do you use a prompt() when a confirm() would be the obvious choice?
May 18 '14 #3

P: 6
how to make the confirm box as center of the page in all browsers.
May 19 '14 #4

P: 6
In this code pop-up looks fine but delete fn not working.
May 19 '14 #5

Dormilich
Expert Mod 5K+
P: 8,639
how to make the confirm box as center of the page in all browsers
you make your own confirm box as you have no influence over how browsers implement the native confirm box.
May 19 '14 #6

Post your reply

Sign in to post your reply or Sign up for a free account.