JavaScript 'Are you sure?' type window prompt
Posted: Tue Jan 31, 2006 10:40 am
Hi guys, another question...
I'm currently coding an application where you can press the delete button and the record will be deleted, but I want some sort of 'Are you sure?' window to appear with OK and Cancel buttons, cancel stops the action, and OK lets it continue. I know I need some JavaScript here, but even with it, would I be able to do something simlar to this...
I'm presuming it's not that simple, and I'm going to have to send some sort of HTTP request using AJAX or whatever.
An example of what I am trying to achieve can be seen by deleting something in PHPMyAdmin.
Can someone tell me how this kind of thing would be done?
Ps. I'm lacking JavaScript experience
Thanks.
I'm currently coding an application where you can press the delete button and the record will be deleted, but I want some sort of 'Are you sure?' window to appear with OK and Cancel buttons, cancel stops the action, and OK lets it continue. I know I need some JavaScript here, but even with it, would I be able to do something simlar to this...
Code: Select all
if user wants to delete a record then
prompt them with an are you sure window
if the user clicked ok in the are you sure window then
delete the record
end if
end ifAn example of what I am trying to achieve can be seen by deleting something in PHPMyAdmin.
Can someone tell me how this kind of thing would be done?
Ps. I'm lacking JavaScript experience
Thanks.