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 to do Confirmation while submit button with dynamic Text?

How to do Confirmation while submit button with dynamic Text?

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nettutorialquestion
7 Posts 4 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.
  • S Offline
    S Offline
    Snehal_14_2_83
    wrote on last edited by
    #1

    Hi everyone, While pressing on SUBMIT button, i want confirmation box with selected text. Suppose some making an order of some shares for some values. I want confirmation that you are going to place an order for X share for X rates. are you sure? How to do with ASP.NET? I have AJAX Toolkit also. I have tried confirmation box of AJAX but not getting dynamic text. Thanx in Advance

    M A 2 Replies Last reply
    0
    • S Snehal_14_2_83

      Hi everyone, While pressing on SUBMIT button, i want confirmation box with selected text. Suppose some making an order of some shares for some values. I want confirmation that you are going to place an order for X share for X rates. are you sure? How to do with ASP.NET? I have AJAX Toolkit also. I have tried confirmation box of AJAX but not getting dynamic text. Thanx in Advance

      M Offline
      M Offline
      Muhammad Gouda
      wrote on last edited by
      #2

      If I faced this problem, I would do the follwoing: I will set the submit button property visble = False, Caption="Yes" and create another invisible reset button with caption = "No" and invisible Lable to hold the confirmation message and pushButton with caption = "Submit/Send" which is actually not a submit button Once the user click the virtual submit, set all invisible controls to visible, generate the message with dynamic text and path it to the lable If the user clieked "Yes" it will submit If he/she clicked "No", the form is cleared and set visible controls to invisible again I hope you like the idea

      Mohammed Gouda foreach(Minute m in MyLife) myExperience++;

      S 1 Reply Last reply
      0
      • M Muhammad Gouda

        If I faced this problem, I would do the follwoing: I will set the submit button property visble = False, Caption="Yes" and create another invisible reset button with caption = "No" and invisible Lable to hold the confirmation message and pushButton with caption = "Submit/Send" which is actually not a submit button Once the user click the virtual submit, set all invisible controls to visible, generate the message with dynamic text and path it to the lable If the user clieked "Yes" it will submit If he/she clicked "No", the form is cleared and set visible controls to invisible again I hope you like the idea

        Mohammed Gouda foreach(Minute m in MyLife) myExperience++;

        S Offline
        S Offline
        Snehal_14_2_83
        wrote on last edited by
        #3

        Thx for reply. Solution which you give is alternate solution for me. With your suggestion it will work. but can't we popup message into messagebox like desktop application?

        D M 2 Replies Last reply
        0
        • S Snehal_14_2_83

          Hi everyone, While pressing on SUBMIT button, i want confirmation box with selected text. Suppose some making an order of some shares for some values. I want confirmation that you are going to place an order for X share for X rates. are you sure? How to do with ASP.NET? I have AJAX Toolkit also. I have tried confirmation box of AJAX but not getting dynamic text. Thanx in Advance

          A Offline
          A Offline
          Arindam Tewary
          wrote on last edited by
          #4

          I assume you have a HTML submit button. Write some javascript function on "onclick" event. Inside jvascript fiunction you must put a javascript confirmation which returns true or false. Accordingly your function will also return true or false. Its the property of Submit button which automatically stops sending data to server if onlcick function returns false. pseudocode

          function onclickfunction ()
          {
          var answer = confirm("you are going to place an order for X share for X rates. are you sure")
          if(answer)
          {
          return true;// goes to server
          }
          else
          {
          return false// always stops sending data to server.
          }
          }
          you have call above function in this way:

          NB: Dont miss "return" statement from calling code.

          Thanks, Arindam D Tewary

          D 1 Reply Last reply
          0
          • S Snehal_14_2_83

            Thx for reply. Solution which you give is alternate solution for me. With your suggestion it will work. but can't we popup message into messagebox like desktop application?

            D Offline
            D Offline
            doWhileSomething
            wrote on last edited by
            #5

            Here is a quick example, you would want to make this a dynamic function though to get whatever values you need from the form controls. <asp:Button ID="Button1" OnClientClick="return confirm('You have selected \'X\' number of shares....'); " runat="server" Text="Button" />

            My Personal Site

            1 Reply Last reply
            0
            • A Arindam Tewary

              I assume you have a HTML submit button. Write some javascript function on "onclick" event. Inside jvascript fiunction you must put a javascript confirmation which returns true or false. Accordingly your function will also return true or false. Its the property of Submit button which automatically stops sending data to server if onlcick function returns false. pseudocode

              function onclickfunction ()
              {
              var answer = confirm("you are going to place an order for X share for X rates. are you sure")
              if(answer)
              {
              return true;// goes to server
              }
              else
              {
              return false// always stops sending data to server.
              }
              }
              you have call above function in this way:

              NB: Dont miss "return" statement from calling code.

              Thanks, Arindam D Tewary

              D Offline
              D Offline
              doWhileSomething
              wrote on last edited by
              #6

              Sorry for the cross post, I never saw your reply (didn't realize the replies wrapped pages).

              My Personal Site

              1 Reply Last reply
              0
              • S Snehal_14_2_83

                Thx for reply. Solution which you give is alternate solution for me. With your suggestion it will work. but can't we popup message into messagebox like desktop application?

                M Offline
                M Offline
                Muhammad Gouda
                wrote on last edited by
                #7

                Snehal_14_2_83 wrote:

                but can't we popup message into messagebox like desktop application?

                The only way is javascript (like shown in the below posts) But, take care that client can disable javascript code

                Mohammed Gouda foreach(Minute m in MyLife) myExperience++;

                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