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. TextBox problem

TextBox problem

Scheduled Pinned Locked Moved ASP.NET
helptutorialquestion
7 Posts 4 Posters 7 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.
  • K Offline
    K Offline
    Kissy16
    wrote on last edited by
    #1

    I have two textbox for adding two values and i need to display in 3rd textbox without any button click event. if i click on 3rd textbox after entering the values in 1,2 textbox,is it give the result in 3rd textbox.If so how?other wise how to that without any button click event/ Like a+b=c txtbox1=a txtbox2=b txtbox3=c Give an idea

    kissy

    D A 2 Replies Last reply
    0
    • K Kissy16

      I have two textbox for adding two values and i need to display in 3rd textbox without any button click event. if i click on 3rd textbox after entering the values in 1,2 textbox,is it give the result in 3rd textbox.If so how?other wise how to that without any button click event/ Like a+b=c txtbox1=a txtbox2=b txtbox3=c Give an idea

      kissy

      D Offline
      D Offline
      danidanidani
      wrote on last edited by
      #2

      you can either do it all client side and use the onblur event on A and B to call a function that checks both A an B for values and if they have values fills C with their sum or you can do it clientside using the autopostback="true" and then using the OnTextChanged event to make the same operations.

      Cheers, Dani

      K 1 Reply Last reply
      0
      • K Kissy16

        I have two textbox for adding two values and i need to display in 3rd textbox without any button click event. if i click on 3rd textbox after entering the values in 1,2 textbox,is it give the result in 3rd textbox.If so how?other wise how to that without any button click event/ Like a+b=c txtbox1=a txtbox2=b txtbox3=c Give an idea

        kissy

        A Offline
        A Offline
        AmitChampaneri
        wrote on last edited by
        #3

        you can use javscript function when you are setting focus to your third textbox. <asp:textbox .... onFocus="javascript:alert('hello');> use your javascript function insteadof alert();

        K 1 Reply Last reply
        0
        • A AmitChampaneri

          you can use javscript function when you are setting focus to your third textbox. <asp:textbox .... onFocus="javascript:alert('hello');> use your javascript function insteadof alert();

          K Offline
          K Offline
          Kissy16
          wrote on last edited by
          #4

          I dont have idea how to write javascript for this type of problem.Give me with an example so that i can try for that. Thanks in advance

          kissy

          P A 2 Replies Last reply
          0
          • K Kissy16

            I dont have idea how to write javascript for this type of problem.Give me with an example so that i can try for that. Thanks in advance

            kissy

            P Offline
            P Offline
            Pavan Naidu
            wrote on last edited by
            #5
            1 Reply Last reply
            0
            • D danidanidani

              you can either do it all client side and use the onblur event on A and B to call a function that checks both A an B for values and if they have values fills C with their sum or you can do it clientside using the autopostback="true" and then using the OnTextChanged event to make the same operations.

              Cheers, Dani

              K Offline
              K Offline
              Kissy16
              wrote on last edited by
              #6

              OnTextChnaged event i need to again ButtonClick event should be fallowed.I cant understand how to use exactly.Give me some example. thanks in advance

              kissy

              1 Reply Last reply
              0
              • K Kissy16

                I dont have idea how to write javascript for this type of problem.Give me with an example so that i can try for that. Thanks in advance

                kissy

                A Offline
                A Offline
                AmitChampaneri
                wrote on last edited by
                #7

                write : function addTwoTextbox { document.getElementById("Textbox3").value = document.getElementById("Textbox1").value + document.getElementById("Textbox2").value; } and call addTwoTextbox() fn where you declared textbox like : <asp:textbox id=... runat=... onFocus="javascript:addTwoTextbox();">

                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