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. Question regarding asp.net web forms

Question regarding asp.net web forms

Scheduled Pinned Locked Moved ASP.NET
asp-netcsharptutorialquestion
6 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.
  • U Offline
    U Offline
    User 13216084
    wrote on last edited by
    #1

    i want to know how to move a next textbox when user click on enter key.

    A 1 Reply Last reply
    0
    • U User 13216084

      i want to know how to move a next textbox when user click on enter key.

      A Offline
      A Offline
      Afzaal Ahmad Zeeshan
      wrote on last edited by
      #2

      Move how? You can change the layout properties, such as the Left Right and other settings, add paddings, change the margins as needed. Also, apart from the Web Forms code, you can do that in JavaScript code as well, handling the events of key, and then changing the CSS properties of the elements. Something like this,

      $("txtBx").keyup(function (event) {
      if(event.which == 13) {
      // Enter key
      var otherTxtBx = $("otherTxtBx");
      otherTxtBx.css("margin", "25px"); // You can surely change other values.
      }
      });

      This was obviously a thousand-feet overview, but since you have not shown any attempt, I believe this will help you out. [.keyup() | jQuery API Documentation](https://api.jquery.com/keyup/) Did you mean to focus on another text box? If that is the case, then you can change the code in the condition, to the following one,

      otherTxtBx.focus(); // Change the focus to a different element

      That would do the trick, also if the requirement is something else (other than these two) you can implement that in the condition block, so that it gets executed when user presses enter key.

      The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~

      Z 1 Reply Last reply
      0
      • A Afzaal Ahmad Zeeshan

        Move how? You can change the layout properties, such as the Left Right and other settings, add paddings, change the margins as needed. Also, apart from the Web Forms code, you can do that in JavaScript code as well, handling the events of key, and then changing the CSS properties of the elements. Something like this,

        $("txtBx").keyup(function (event) {
        if(event.which == 13) {
        // Enter key
        var otherTxtBx = $("otherTxtBx");
        otherTxtBx.css("margin", "25px"); // You can surely change other values.
        }
        });

        This was obviously a thousand-feet overview, but since you have not shown any attempt, I believe this will help you out. [.keyup() | jQuery API Documentation](https://api.jquery.com/keyup/) Did you mean to focus on another text box? If that is the case, then you can change the code in the condition, to the following one,

        otherTxtBx.focus(); // Change the focus to a different element

        That would do the trick, also if the requirement is something else (other than these two) you can implement that in the condition block, so that it gets executed when user presses enter key.

        The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~

        Z Offline
        Z Offline
        ZurdoDev
        wrote on last edited by
        #3

        I think user actually means to move the cursor to a text box. Not actually move the text box, although it does sound that way.

        There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.

        A U 2 Replies Last reply
        0
        • Z ZurdoDev

          I think user actually means to move the cursor to a text box. Not actually move the text box, although it does sound that way.

          There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.

          A Offline
          A Offline
          Afzaal Ahmad Zeeshan
          wrote on last edited by
          #4

          Right, might have been. I updated my answer nonetheless. :-) Thank you for reminder.

          The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~

          Z 1 Reply Last reply
          0
          • A Afzaal Ahmad Zeeshan

            Right, might have been. I updated my answer nonetheless. :-) Thank you for reminder.

            The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~

            Z Offline
            Z Offline
            ZurdoDev
            wrote on last edited by
            #5

            :thumbsup: +5

            There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.

            1 Reply Last reply
            0
            • Z ZurdoDev

              I think user actually means to move the cursor to a text box. Not actually move the text box, although it does sound that way.

              There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.

              U Offline
              U Offline
              User 13216084
              wrote on last edited by
              #6

              yes move cursor on click to next texbox

              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