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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. There r two Submit Buttons

There r two Submit Buttons

Scheduled Pinned Locked Moved ASP.NET
6 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.
  • H Offline
    H Offline
    Hemant Garg
    wrote on last edited by
    #1

    I hav twwo submit buttons each coresponding to one texbox each... I want that When i write in textbox1 then default button should be Button1 and if i write in TextBox2 then default button should be Button2.. Default means that when i press enter key then The default button is pressed....

    V J U 3 Replies Last reply
    0
    • H Hemant Garg

      I hav twwo submit buttons each coresponding to one texbox each... I want that When i write in textbox1 then default button should be Button1 and if i write in TextBox2 then default button should be Button2.. Default means that when i press enter key then The default button is pressed....

      V Offline
      V Offline
      Viral Upadhyay
      wrote on last edited by
      #2

      it can possible by javascript in keypress event of textbox you can check for enter key and call appropreate button as form submit button

      Viral YahooID : just_viral My Site : www.theseoworld.info

      H 1 Reply Last reply
      0
      • V Viral Upadhyay

        it can possible by javascript in keypress event of textbox you can check for enter key and call appropreate button as form submit button

        Viral YahooID : just_viral My Site : www.theseoworld.info

        H Offline
        H Offline
        Hemant Garg
        wrote on last edited by
        #3

        I don't know the use of java script.... could u halp me how to do this

        V 1 Reply Last reply
        0
        • H Hemant Garg

          I hav twwo submit buttons each coresponding to one texbox each... I want that When i write in textbox1 then default button should be Button1 and if i write in TextBox2 then default button should be Button2.. Default means that when i press enter key then The default button is pressed....

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

          Hi, Simply.. You may use Panel control for each group. It has the attribute "DefaultButton".

          Regards, Jay :)

          1 Reply Last reply
          0
          • H Hemant Garg

            I don't know the use of java script.... could u halp me how to do this

            V Offline
            V Offline
            Viral Upadhyay
            wrote on last edited by
            #5

            if(window.event.keyCode==13) { var but = document.getElementById('Your Button ID'); but.click(); } This is sample code you can Modify as you like

            Viral YahooID : just_viral My Site : www.theseoworld.info

            1 Reply Last reply
            0
            • H Hemant Garg

              I hav twwo submit buttons each coresponding to one texbox each... I want that When i write in textbox1 then default button should be Button1 and if i write in TextBox2 then default button should be Button2.. Default means that when i press enter key then The default button is pressed....

              U Offline
              U Offline
              Urs Enzler
              wrote on last edited by
              #6

              In ASP.NET 2.0 you can define the DefaultButton per Panel. Therefore use two Panels (Panel 1 containing TextBox 1, Panel 2 containing TextBox 2) Define DeautlButton on Panel 1 to be Button 1 and accordingly for the second Panel. Finished ;-) Happy Programming urs

              -^-^-^-^-^- no risk no funk

              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