Alert Box Popup To Confirm Before Deleting Entry?
Jan 25, 2010
I am working on a PHP web application for my company and have run into a problem with Javascript. In a list I am displaying from a Mysql database, I have the option to delete certain entries. Before someone deletes an entry though, I want them to have an alert box pop up and asked then if they are sure. I have this simple javascript function in the head of the page, but whether cancel or ok are pressed, the page refreshes to the link. How can I fix it so that if you press cancel, nothing happens, other then the alert box goes away, but also allows the link to process if OK is pressed?
HTML Code:
<script type="text/javascript">
function show_confirm(){
var r=confirm("Press a button!");
if (r==true){
alert("You pressed OK!");
}else{
alert("You pressed Cancel!");
}}
</script>
View 7 Replies
ADVERTISEMENT
Dec 27, 2007
On some sites I have worked on, users can delete content from their site. When they go to delete an item, I take them to a page where I pull the item details of the item they are about to delete from the dbase, and say "Are you sure you want to delete so and so". They can choose Yes / No. Yes takes them to action that runs the SQL to delete the item from the dbase. No takes them to the previous page.
I have seen some sites that have managed this process differently, where, instead of being taken to another page, a little pop up box opens saying "Are you sure", with a Yes / No option on it. Yes takes you to delete the item, No leaves them on the page they are on.
Am I right that this method uses Javascript? I know that it won't work if javascript is turned off, but - most people don't turn it off...
View 7 Replies
View Related
Nov 13, 2010
i am facing a problem after using jquery jconfirm alert. Issue is that after receiving confirm alert, when user press tab to go on Cancel button and press Enter key there, despite of firing event of Cancel button, it fires the event of OK button. this issue is not produced when user press the cancel button by mouse. Waiting for your replies.
View 1 Replies
View Related
Nov 13, 2003
How would I go checking if a certain submit button was pushed and if so confirm the user if he is sure. But if he pushes cancle, then it will cancle the operation.
View 4 Replies
View Related
Jul 23, 2005
A description of the problem:
1) Go to a page with various settings and a timeout (forces re-login
if over 10 minutes)
2) Before the timeout, make some changes to settings.
3) Press a "reset to defaults" button that uses a confirmation box to
let the user know what is about to be reset (lists items).
4) Walk away while the confirm box is displayed and come back after
the page timeout.
5) My screen now has the page, a confirm popup on top of that, and a
timeout alert on top of that.
6) Press OK to dismiss the timeout alert. The underlying page goes to
the login screen, but the confirm box remains.
How can I clear any javascript alert/confirm popups in this situation
automatically?
View 7 Replies
View Related
Jul 9, 2009
i am calling one function after another.
The below code shows a confirmation box and redirects to [URL]
Code:
<script type="text/javascript">
function todo(){
window.location="http://www.yahoo.com";
}
[Code]....
View 1 Replies
View Related
Apr 3, 2006
I'm pretty sure after reading this board and many like it that it is
impossible to change the ok, ok/cancel buttons that appear by default
in the alert and confirm javascript dialogs. Now for question one why
not? And question two why do they still say ok and ok/cancel when
viewed in a non-english browser install?
I have installed Chinese IE 6.0 and these buttons still say Ok/Cancel.
the rest of the browser (buttons, menus, etc...) is in Chinese except
for these two stupid buttons. No one final question, whould having a
reginonal OS installed make any difference. Right now I'm using an
English OS but with the Chinese browser mentioned above.
View 1 Replies
View Related
Nov 25, 2006
This confirm alert works except I want when the user clicks on OK that the newwindow.html page loads.
onClick="if(confirm('Are you sure you want to exit?'))alert('The program is still running in the Taskbar...');location='../newwindow.html' target='_blank'else alert('YOu chose not to leave - good!')"
That bit in red doesn't seem to do the trick. Neither does document.location.
View 4 Replies
View Related
Apr 4, 2011
I am using the validate plugin to perform validations on a form.I would like to show a confirm message ( alert with ok and cancel ) upon submit and successful vaildation.I have tried the following but it does not work:[code]The form submits even If I click "Cancel". Is there anythingwrong with my code above?
View 6 Replies
View Related
Jul 21, 2005
I have never done any javascript at all but I think it can do what I want with ease.
Basically at the moment I have a link that calls a delete script written in php. The delete script just deletes and item from my mysql database. What I would like is a popup to appear when the link is clicked that asks for the user to confirm they wish to delete.
Could anyone either show and example or point me to a site that may have a tutorial or something.
View 6 Replies
View Related
Jun 22, 2009
i have a site www.yusinglighting.com.i use javascript entry this site that could open another window,now i want to entry this site that onload a div in current window in the internet, i found many popup div of programs that need "click" like jquery floatbox plug.
View 3 Replies
View Related
Jun 28, 2005
I am working on a ASP.NET application and have some forms that require to be popped up and let the user edit information on them. These windows must stay in focus until closed, but I have having some issues implementing this.
We are targeting IE explorers and have tried the showModal() which is exactly what we require (as it forces the user to the window till complete) but the page cannot refresh/postback which is what we need.
I also tried the on blur = self.focus() but that doesnt work either as when I user clicks the textbox on that popup to update a datagrid the focus is taken off the textbox and to the window again.
What I'm trying to achieve it a popup window that has focus until complete and allows the window to refresh as it requires use to update & delete a datagrid. Any ideas?
View 1 Replies
View Related
Jul 27, 2010
I need a Thickbox or popup mechanism to Upload File and Registration Details .
View 2 Replies
View Related
Oct 5, 2010
Is there any way to popup a javascript confirmation on clicking an accordion header to confirm the change of section?
View 3 Replies
View Related
May 14, 2010
Is it possible to change the "OK" text in an alert confirm box?
View 4 Replies
View Related
Aug 1, 2005
I have a textbox on one of my forms that is used to accept a time from the
user. I need to write this value to a database to trigger an event later on.
What I'd like to know is...
Are there any functions in javascript that can convert different time
formats to a known format (24 hour clock)... 5pm -> 17:00 or 5:00 to 05:00,
etc. ???
Assuming that I get the input into a 24 hour format, how can I create a full
time/date variable with todays date and the users entered time?
Finally, if the entered time is earlier than the current time, how can I
create the above date/time combination using tomorrows date?
View 2 Replies
View Related
Sep 14, 2009
I've been using a javascript confirm() box on submission of certain forms (i.e. when deleting a record) but I cannot get any popups to work in IE7. Even the simplest:
<script type='text/javascript'>alert('Test');</script>
In the <head> of the page isn't working. All my other browsers show it perfectly, including IE6.Is this to do with the security settings of IE7?
View 2 Replies
View Related
Aug 22, 2011
I've seen several sites that use what looks like the alert function (I know it isn't), where the site gets darkened and a popup box (similar to that of the alert one) comes up and displays an image (and only an image)
View 2 Replies
View Related
Jul 2, 2009
How do I show an alert/popup msg to the user if (items.Count < 1)?
View 3 Replies
View Related
Jul 1, 2010
I want to display a Popup alert if select all checkbox is selected and number of rows in the grid are more than the number of check boxes selected. This code does that but it does on the second click on the select all check box, not on the first click.correction:
Code:
<script type="text/javascript">
var TotalChkBx;
[code]....
View 4 Replies
View Related
Jun 21, 2009
jQuery,<div>
That the page was finished loading? but what I see is that the popup alert comes before my images on my page.....
finished loading? is this correct?
I need to do something to my page when everything is done loading.. how does one do that.
View 3 Replies
View Related
Jan 13, 2012
I am using an alert dialog function I found online. The support for it has closed.Here is the page showing my alert button:Click here to view my test pageYou can check out the source html and the linked jquery files.The alert button works correctly by displaying an alert box.How do I apply this same behavior to a link?I want a user to click on the link, and:(1) receive the message they are leaving the site, then(2) be redirected to the other URL.
View 7 Replies
View Related
Sep 18, 2011
I want to pop up alert when the user browse file into input for example I have this input:
HTML Code:
<input type="file" name="myfiles[]" />
Now, when the user finish to browse an file I want a function to start working, what I mean by finish browse file is when the user select file and than click on the file he selected twice and than when the browsing files windows close I want this function to start.
View 3 Replies
View Related
Mar 12, 2010
This script show one fixed popup ( like message alert box ) Now i want show it after 10 minutes.
Code:
View 5 Replies
View Related
May 31, 2010
Pressing the enter key of the following page (created by JSP) submit page more than once.
Both alert popup boxes appear as expected:
However, then this alert appear again, which is unexpected:
But alert('alarmgroup ' + alarmgroup + ' rowsPerPage ' + rowsPerPage); do not appear.
View 1 Replies
View Related
Mar 24, 2011
Is it possible for Javascript to check if the visitor's browser has enabled the option to print background images, and if not to popup an alert?
View 1 Replies
View Related