Confirm alert problem

Results 1 to 2 of 2

Thread: Confirm alert problem

  1. #1
    Join Date
    Dec 1969

    Default Confirm alert problem

    I am trying to use a confirm alert to stop a page being called if the user presses "cancel". At the minute if you press cancell the page is called anyway. How do i stop the page being called if you press "cancel" and let it be called if you press"OK"<BR><BR><BR>&#060;script language="JavaScript"&#062;<BR> <BR> function DeleteOK(LineNumber) {<BR> number = LineNumber<BR> message = "Are you sure you want to delete caller number" + " " + number<BR> confirm(message)<BR> return false;<BR> &#060;/script&#062;<BR><BR><BR>&#060;form method="post" action="DeleteCaller.cfm?CallerID=2" name="Caller2" onsubmit="DeleteOK(&#039 2&#039)"&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Confirm problem

    1. &#060;form method="post" action="DeleteCaller.cfm?CallerID=2" name="Caller2" onsubmit="return DeleteOK(&#039 2&#039);"&#062;<BR><BR>got that?<BR><BR>2. function DeleteOK(LineNumber) {<BR> message = "Are you sure you want to delete caller number" + " " + LineNumber;<BR> return confirm(message);<BR>}<BR><BR>now it&#039ll work. btw alert() and confirm() are two different methods, stop confusing them!<BR><BR>j<BR><BR>

Posting Permissions

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