Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Disabling pressing enter key

I have created a form where i enter some data, and this form link to another form where i put a button to open the second form, this work fine. But now when i press enter key on my first form while entering data (instead of pressing the tab key) the second form get immediately open, i don't know why this happen, any one give suggestion or help. I would be very thankfull. What makes the enter key activate to open the form ?

Zela.

Comments

  • satyavirsatyavir Member Posts: 3
    : I have created a form where i enter some data, and this form link to
    : another form where i put a button to open the second form, this work
    : fine. But now when i press enter key on my first form while entering
    : data (instead of pressing the tab key) the second form get
    : immediately open, i don't know why this happen, any one give
    : suggestion or help. I would be very thankfull. What makes the enter
    : key activate to open the form ?
    :
    : Zela.
    :

    Hi Zela
    Follow the steps
    1: Modify your page body tag as
    [b][/b]

    2. Write the javascript method on your page as:

    function CaptureEnter()
    {
    if (window.event.keyCode == 13)
    {
    window.event.cancelBubble = true;
    window.event.returnValue = false;
    }
    }

    Thanks
    Satyavir Yadav

  • honest_dudehonest_dude Member Posts: 93
    Well, my problem is about Visual basic application, i am not very sure it works with your java thing mention here, will work ?
  • vibin_mdcpvibin_mdcp Member Posts: 60
    : Well, my problem is about Visual basic application, i am not very
    : sure it works with your java thing mention here, will work ?

    Add a KeyUp Event handler and compare KeyCode with a vbKeyCodeConstants
    (here you have to compare with 'vbKeyExecute')
  • satyavirsatyavir Member Posts: 3
    : : Well, my problem is about Visual basic application, i am not very
    : : sure it works with your java thing mention here, will work ?
    :
    : Add a KeyUp Event handler and compare KeyCode with a
    : vbKeyCodeConstants
    : (here you have to compare with 'vbKeyExecute')
    :

    Well,
    As I understod you want to use it in a web application. Then it will work for sure.
    Thanks & regards
    Satayvir
Sign In or Register to comment.