confirm window with (Y) & (N) ????

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terry

    #1

    confirm window with (Y) & (N) ????

    anyone know how to pop up a confirm window with (Y) & (N)??
    I want to pop up a "Do you want to continue?" message box (javascript
    only, can't use vbscript) with (Y) & (N). when click (N), then close
    the current window. If click (Y), then back to server side to
    continue. Is it possible?? Thanks a lot.
  • Hal Rosser

    #2
    Re: confirm window with (Y) & (N) ????

    try this


    "Terry" <drexelterry@ao l.com> wrote in message
    news:3a5f0251.0 409011919.455df 077@posting.goo gle.com...[color=blue]
    > anyone know how to pop up a confirm window with (Y) & (N)??
    > I want to pop up a "Do you want to continue?" message box (javascript
    > only, can't use vbscript) with (Y) & (N). when click (N), then close
    > the current window. If click (Y), then back to server side to
    > continue. Is it possible?? Thanks a lot.[/color]


    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.744 / Virus Database: 496 - Release Date: 8/24/2004


    Comment

    • Randy Webb

      #3
      Re: confirm window with (Y) &amp; (N) ????

      Hal Rosser wrote:[color=blue]
      > "Terry" <drexelterry@ao l.com> wrote in message
      > news:3a5f0251.0 409011919.455df 077@posting.goo gle.com...
      >[color=green]
      >>anyone know how to pop up a confirm window with (Y) & (N)??
      >>I want to pop up a "Do you want to continue?" message box (javascript
      >>only, can't use vbscript) with (Y) & (N). when click (N), then close
      >>the current window. If click (Y), then back to server side to
      >>continue. Is it possible?? Thanks a lot.[/color][/color]

      No, you can not change the confirm dialog window.
      [color=blue]
      > try this
      > http://www.codeave.com/javascript/code.asp?u_log=7035[/color]

      Here is the code from that page:

      [color=blue]
      > <script language="JavaS cript">[/color]

      language is deprecated, use the type attribute instead.
      [color=blue]
      > <!--[/color]

      SGML Delimiters are not needed.
      [color=blue]
      > function confirm_entry()
      > {
      > input_box=confi rm("Click OK or Cancel to Continue");
      > if (input_box==tru e)[/color]

      confirm returns only two values, true and false. You can simply test
      input_box:

      if(input_box)
      [color=blue]
      > {
      > // Output when OK is clicked
      > alert ("You clicked OK");
      > }
      >
      > else
      > {
      > // Output when Cancel is clicked
      > alert ("You clicked cancel");
      > }
      >
      > }[/color]

      Every bit of that code could be written as:

      function confirm_entry() {
      if (confirm("Click OK or Cancel to Continue"){
      alert("You clicked OK")
      }else{
      alert("You didn't click OK")
      }
      }
      [color=blue]
      > -->[/color]

      Thats technically a syntax error that browsers correct. If you are
      intent on using SGML Delimites, the closing one must be //--> for it to
      be correct.
      [color=blue]
      > </script>
      > Click <a href="JavaScrip t:confirm_entry ()">here</a>[/color]

      And if javascript is disabled? Your link doesn't work. See:


      All in all, the code you linked to is pretty shabby.

      --
      Randy
      comp.lang.javas cript FAQ - http://jibbering.com/faq

      Comment

      Working...