i am making a page where different users have to login to use their portal... here, i have created a form where user enters data,, as user opens the form, the record is created in database and user input is updated in database.. now what i wanted is when user clicks on save, then only record that is updated is stored.. if user clicks on exit or close button of browser or other button or any other control except save, the message should appear like "Are you sure you want to leave page" and if user clicks on yes, the record is to be deleted... how can i create such control that asks user a permission if they want to quit or continue and then delete a record is yes is selected???
Is it that it can be done by javascript?? or i need to use other tools??