I am trying to use cfmessage box to confirm prior to deleting a record. I have a delete button that I am diplaying the fessage box using onclick. The problem I am having is the cfmessagebox pop's up, but the record gets deleted anyway and the cfmessagebox goes away. Basically, the form is getting submitted regardless. I am thinking I am doing something wrong here, but can someone point me in the right direction. Below is come code snippets:
<cfmessagebox type="confirm" name="confirmdelete" title="Delete Employee?"
message="Are you sure you want to delete this employee?"
buttonType="YesNo" icon="warning" labelYes="Yes" labelNo="No">
I am pretty sure I should change the button type to "button" rather than submit. Then, use calbackhandler to submit the form. However, once the form is submitted, I check for which button is pressed using:
Any ideas on what I am doing wrong? Or, any better ways to do this?
Europe, Middle East and Africa