How can I have a confirm box

Results 1 to 3 of 3

Thread: How can I have a confirm box

  1. #1
    Join Date
    Dec 1969

    Default How can I have a confirm box

    How to create confirm box in javascript? I have a Delete button and when it is clicked I want a javascript confirm box to appear, then if the user clicks &#039;Yes&#039; I want to call a VB Sub in my code to execute a certain delete command. I however cannot get the confirm box to appear when the user clicks "delete" and cannot call the delete function from javascript.<BR><BR>Can anyone help me with this conundrum.Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: How can I have a confirm box

    There is a way that you can have Client Side Script for Server side controls.<BR>Do this:<BR>1) In your Page_Load event use:<BR>Me.cmdDelete.Attributes.Add("onClick","sho wPopUp()"<BR><BR>2) Go to your HTML view and write a JavaScript function called showPopUp and and have it display the message box. Use the alert() function avaialable in JavaScript.<BR><BR>Hoep this helps....

  3. #3
    Join Date
    Dec 1969

    Default The big question

    Should be the confirm() method in the javascript code.<BR>window.confirm(&#039;Conform delete?&#039;);<BR><BR>But if the confirm method returns false, that is, user clicks Cancel, how do you prevent the form from being submitted?

Posting Permissions

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