Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Ok Cancel button using javascript [modified]

Ok Cancel button using javascript [modified]

Scheduled Pinned Locked Moved ASP.NET
toolsjavascriptcomtestingquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    padmanabhan N
    wrote on last edited by
    #1

    Hi Experts, I have to show ok cancel button in popup and while clicking ok it should proceed and cancel should remain the same. Any idea, please provide. Modified : i need this is code behind.

    Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

    modified on Monday, December 13, 2010 6:03 AM

    S N 2 Replies Last reply
    0
    • P padmanabhan N

      Hi Experts, I have to show ok cancel button in popup and while clicking ok it should proceed and cancel should remain the same. Any idea, please provide. Modified : i need this is code behind.

      Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

      modified on Monday, December 13, 2010 6:03 AM

      S Offline
      S Offline
      Sandeep Mewara
      wrote on last edited by
      #2

      Well, design your popup with two buttons... 'Ok' & 'Cancel'. Define OnClientClick event on both of them. Based on the button, different javascript event would be called. If it's a Cancel button then cancel the request, just return false. If it's an 'Ok' button, move on. There are lots of examples on the same. In case needed, just Google for 'Ok Cancel Javascript'

      1 Reply Last reply
      0
      • P padmanabhan N

        Hi Experts, I have to show ok cancel button in popup and while clicking ok it should proceed and cancel should remain the same. Any idea, please provide. Modified : i need this is code behind.

        Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

        modified on Monday, December 13, 2010 6:03 AM

        N Offline
        N Offline
        NeverHeardOfMe
        wrote on last edited by
        #3

        padmanabhan N wrote:

        Ok Cancel button using javascript

        So why have yuou posted this here instead of the Javascript forum? This is pretty basic Javascript which you cuold solve yourself with a little Googling. But anyway, try here[^] for starters

        P 1 Reply Last reply
        0
        • N NeverHeardOfMe

          padmanabhan N wrote:

          Ok Cancel button using javascript

          So why have yuou posted this here instead of the Javascript forum? This is pretty basic Javascript which you cuold solve yourself with a little Googling. But anyway, try here[^] for starters

          P Offline
          P Offline
          padmanabhan N
          wrote on last edited by
          #4

          I am asking about code behind. I have few samples like btnImport.Attributes.Add("onclick", "javascript:return " + "confirm(Are you sure you want to create?')"); But this is not working.

          Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

          N 1 Reply Last reply
          0
          • P padmanabhan N

            I am asking about code behind. I have few samples like btnImport.Attributes.Add("onclick", "javascript:return " + "confirm(Are you sure you want to create?')"); But this is not working.

            Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

            N Offline
            N Offline
            NeverHeardOfMe
            wrote on last edited by
            #5

            OK - you don't really need the "javascript:" bit, but apart from that, and the fact that you have missed out ther opening ' at the start of your message (before the word "Are"), it should work:

            btnImport.Attributes.Add("onclick", "return confirm('Are you sure you want to create?')");

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups