Solved

Stop Jumping of input screen when selecting enter button to move from field to field

Posted on 2012-03-30
2
255 Views
Last Modified: 2012-03-30
Hello everyone,

I have a web form that is jumping each time the user moves from textbox fields and drop down fields when data is entered using the Enter Key.  

Someone gave me this code to stop the jumping, but I do not know where to place the coding to completely stop the jumping in the web form.

The coding:  onkeydown="javascript:if(window.event.keyCode == 13) window.event.keyCode = 9;">

I need this coding above to apply to the entire web form.  Do I need to enter this coding on every field in the HTML coding screen?

jjc9809
0
Comment
Question by:jjc9809
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 37788067
You can put the code in one function and then associate that function with keypress of each textbox. What do you mean by jumping by the way?
0
 

Author Comment

by:jjc9809
ID: 37788576
CodeCruiser,

I have set each textbox TextChanged event to check if the textbox >= Nothing Then
set the focus to the next textbox or drop downlist.

For example on the textbox DriverLicense_ID, I have this vb coding in the textchanged
event.  

        Protected Sub PK_DriverLicenseID_vch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PK_DriverLicenseID_vch.TextChanged

        If PK_DriverLicenseID_vch.Text >= Nothing Then
            DDLState.Focus()
        End If
    End Sub

This takes the cursor to DDLState drop down list when the enter button is selected.

For example on the dropdownlist field, DDLState I have this vb coding in the SelectedIndexchanged event.

Protected Sub DDLState_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DDLState.SelectedIndexChanged
        If DDLState.SelectedIndex >= Nothing Then
            DDLFK_IntelligenceType_vch.Focus()
        End If
    End Sub




The screen movement or jump is occuring when the enter button is selected.  Maybe my coding  above is doing this.  The textbox has the property set for autopostback as "true" on every field.  If I set the autopostback to false, the cursor does not go to the next field which in this case is the drop down list DDLState.  I want the cursor to go to the next field after enter is selected.  

jjc9809
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question