Results 1 to 2 of 2

Thread: MessageBox

  1. #1
    Join Date
    Dec 1969

    Default MessageBox

    How do I trigger a MessageBox to open with the buttons Yes and No through Java Script? I need this for confirming a delete record. Is there any other way you suggest. Thanks.

  2. #2
    Join Date
    Dec 1969

    Default RE: MessageBox

    Use an onClick of onSubmit in the href of the button (onSubmit if it is a form). It should look something like this:<BR><BR>&#060;a href="deletingpage.asp" onClick="areyousure()"&#062;&#060;img src=button.gif&#062;&#060;/a&#062;<BR><BR>In the head of your page that the button is on, you need to make a function like this:<BR><BR>&#060;script language=JavaScript&#062;<BR>function areyousure() <BR>{ <BR>if (!confirm("Are you sure you want to delete this item?")) {<BR> history.go(-1);return " "}<BR>}<BR>&#060;/script&#062;<BR><BR>Good Luck.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts