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. how can i get return value (true and false ) from a confirm box using java script?

how can i get return value (true and false ) from a confirm box using java script?

Scheduled Pinned Locked Moved ASP.NET
questionjavacomtools
10 Posts 6 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.
  • I Offline
    I Offline
    imran_rafique
    wrote on last edited by
    #1

    how can i get return value (true and false ) from a confirm box using java script? r00d0034@yahoo.com

    E 1 Reply Last reply
    0
    • I imran_rafique

      how can i get return value (true and false ) from a confirm box using java script? r00d0034@yahoo.com

      E Offline
      E Offline
      enjoycrack
      wrote on last edited by
      #2

      var ret = confirm(...) << >>

      I 1 Reply Last reply
      0
      • E enjoycrack

        var ret = confirm(...) << >>

        I Offline
        I Offline
        imran_rafique
        wrote on last edited by
        #3

        But i want to get that value in vb.net r00d0034@yahoo.com -- modified at 6:26 Friday 17th February, 2006

        J I 2 Replies Last reply
        0
        • I imran_rafique

          But i want to get that value in vb.net r00d0034@yahoo.com -- modified at 6:26 Friday 17th February, 2006

          J Offline
          J Offline
          J4amieC
          wrote on last edited by
          #4

          Javascript runs on the client. Your VB.NET code runs on the server...therefore to get that javascript variable to your VB.NET you will need to post it to the server.

          M 1 Reply Last reply
          0
          • J J4amieC

            Javascript runs on the client. Your VB.NET code runs on the server...therefore to get that javascript variable to your VB.NET you will need to post it to the server.

            M Offline
            M Offline
            Mr Naveed Butt
            wrote on last edited by
            #5

            Add an attribute to the button on the asp.net button on the Page_Load then when you click the button, the javascript code will be called and you will be able to call the function

            I 1 Reply Last reply
            0
            • I imran_rafique

              But i want to get that value in vb.net r00d0034@yahoo.com -- modified at 6:26 Friday 17th February, 2006

              I Offline
              I Offline
              Ista
              wrote on last edited by
              #6

              place it into a hidden field. then on postback you can read the value 1 line of code equals many bugs. So don't write any!!

              I 1 Reply Last reply
              0
              • M Mr Naveed Butt

                Add an attribute to the button on the asp.net button on the Page_Load then when you click the button, the javascript code will be called and you will be able to call the function

                I Offline
                I Offline
                imran_rafique
                wrote on last edited by
                #7

                Can you please give me sample code ? so that i can have clear idea how to do it ? r00d0034@yahoo.com

                1 Reply Last reply
                0
                • I Ista

                  place it into a hidden field. then on postback you can read the value 1 line of code equals many bugs. So don't write any!!

                  I Offline
                  I Offline
                  imran_rafique
                  wrote on last edited by
                  #8

                  plz give me sample code for that r00d0034@yahoo.com

                  I 1 Reply Last reply
                  0
                  • I imran_rafique

                    plz give me sample code for that r00d0034@yahoo.com

                    I Offline
                    I Offline
                    Ista
                    wrote on last edited by
                    #9

                    document.getElementByID('myHiddenField').value = 'Hello World'; create a hiddeb field with the HTML tab under your toolbox called "myHiddenField" Nick 1 line of code equals many bugs. So don't write any!!

                    R 1 Reply Last reply
                    0
                    • I Ista

                      document.getElementByID('myHiddenField').value = 'Hello World'; create a hiddeb field with the HTML tab under your toolbox called "myHiddenField" Nick 1 line of code equals many bugs. So don't write any!!

                      R Offline
                      R Offline
                      ravihd
                      wrote on last edited by
                      #10

                      Place this code in class Public Shared Sub CreateConfirmBox(ByRef btn As WebControls.Button, _ ByVal strMessage As String) btn.Attributes.Add("onclick", "return confirm('" & strMessage & "')") End Sub use below mention code to call CreateConfirmBox(Me.btnCancel, "Are you sure to Cancel this record") This calls an attributes when user click button First confirm is called then button click if user select yes then button click is called Happy programming Regards ravi d

                      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