Jump to content

Alerting a (yes or no) option before deleting?


sync2007

Recommended Posts

 

Hello everybody...

 

I'm asking if there is a way in PHP to alert a message box containing (Yes and No) when a user clicks on an html submit button that performs a deleting operation, and cancels the operation if he chooses (No) otherwise if he chooses (Yes) it performs the operation?

 

 

Hello everybody...

 

I'm asking if there is a way in PHP to alert a message box containing (Yes and No) when a user clicks on an html submit button that performs a deleting operation, and cancels the operation if he chooses (No) otherwise if he chooses (Yes) it performs the operation?

 

You need something like this in your form:

 

<form ... onsubmit="return confirmSubmit();" ... >

 

And the confirmSubmit function is:

 

  function confirmSubmit(){
   return confirm('Do you really want to submit the form?');
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.