Click here to Skip to main content
15,888,979 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a database web application one of its function is to delete a record from the database.

I need to prompt the user with some information of the record that will be deleted and in the same time ask the user to specify a reason of deletion to be stored in the database. Can anyone tell me how can I do that with javascript and asp.net? is this possible?

How can I send data to the javascript to be displayed in the input box? and how can I get the data from the javascript input box?

Many thanks,
Missa
Posted

1 solution

You have two tasks to perform as per your explanation:
1) Get a confirmation from user that deletion of record is OK with him/her.
2) Record a reason for deletion.

Task 1 can be accomplished using javascript confirm box, code snippet given below:
JavaScript
function delete_confirm()
{
  var r=confirm("This will delete the record. Are you sure you want to continue?")
  if (r==true)
  {
      // Here comes Task 2
      window.open("DeleteReason.aspx");//Open a popup here which will have a textbox and a submit button, where user will enter reason and submit. On submit button click, update the reason field in the database and close the this window.
  }
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900