Preventing enter key from submission-- javaScript

Hi,
I am using the following code for preventing enter button from submission
It is not working for other explorer's like AOL,FIREFOX,NETSCAPE
onkeydown="if ((event.which && event.which == 13) ||
(event.keyCode && event.keyCode == 13))
{document.FormName.ButtonName.click();return false;}
else return true;"
Can any one help me better solution than this...
Thanks in advance...

Double-posted:
http://forum.java.sun.com/thread.jspa?threadID=5131933
(And this is still a java and not javascript forum)

Similar Messages

  • Prevent Enter key from proceeding movie

    I am using this code to get the user to enter the answer 16
    in an input text field. It works but if the user hits the enterkey
    after they've gotten the question right, the playhead starts and
    moves to incorrect. This is not happening only in the testing
    environment, the published file continues when Enter is pressed.
    Can anyone help?
    keyListener = new Object();
    keyListener.onKeyUp = function() {
    if (input_txt2.text == "16" and Key.getCode() == 13) {
    //13 is key code for 'Enter'//
    gotoAndPlay("1_3_13a");
    _root.answer1 = "Correct!";
    } else if (input_txt2.text != "16" and Key.getCode() == 13)
    //13 is key code for 'Enter'//
    _root.answer1 = "Incorrect.";
    gotoAndPlay("1_3_13b");
    Key.addListener(keyListener);

    I'm not following what "…activated when the enter key
    is pressed even after the event has occurred." means. You mean that
    even after this first entry you press enter and the value of
    input_txt2.text != "16" so it is jumping to 1_3_13B?
    I think I know what you mean, maybe. Notice how you are
    setting up a listener? Well it keeps listening, it isn't a one time
    deal. It listens for a keyUp until you tell it to stop. So just
    because it works once why would you expect it to stop working? :)
    What you need to do is either inside your conditionals or
    perhaps just inside the onKeyUp function put a
    Key.removeListener(keyListener); to tell it to stop listening. If
    you are doing some kind of remediation at 1_3_13b and then want
    them to have another try, perhaps you will want to leave the
    listener or you might want to remove it and then add it back. I
    don't know the exact structure of what you are doing, but I hope
    this points you in the correct direction.

  • How to prevent Enter key from closing form?

    I have a page with a single text entry field on it. When I press enter the page closes, not saving the data (it is as if I clicked cancel). How can I change this behavior?

    Hi Daveio,
    Can you please let me know whether the Text Field that you have created is of type:
    Text Field (always submit page when entered pressed)?
    Secondly, does your page have any branches associated with it?
    Tony.

  • Pai module enter key from key board

    hi
    can any one tell me how can i display material description after entering material no in screen  .
    by just clicking enter key from keyboard .
    Regards
    Rakesh singh

    Use a case statement.
    CASE ok_code.
    When Others.
    *********Write code to read material description from table or Internal table ***********
    Pass the description to the field on the screen. To do this define a work area with same name of screen element
    End case.
    Now the value will automatically be populated.

  • In the address bar where type the address of the web site at the top. after entering the address i press enter key from the keyboard but it does'nt work there . Means the page is not navigating towards the address. Kindly solve the problem

    In the address bar where type the address of the web site at the top. after entering the address i press enter key from the keyboard but it doesn't work there . Means the page is not navigating towards the address. Kindly solve the problem

    This issue can be caused by an extension that isn't working properly.
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    * [[Troubleshooting extensions and themes]]
    In Firefox 4 you can use one of these to start in <u>[[Safe mode]]</u>:
    * Help > Restart with Add-ons Disabled
    * Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows)

  • How can i distingush Enter key from Numpad-Enter(Enter key on numpad)?

    How can i distingush Enter key from Numpad-Enter key(Enter key on numpad)?
    Enter KeyEvent information is identical with Numpad-Enter key(Enter key on numpad) KeyEvent.
    ( keyChar, keyCode, ..etc)
    But i must differentiate these two Enter keys.
    How can i make it?
    Thank you for your answer ahead.

    The keyCode for 1 in the numeric pad is 97 the other 1 is 49, the same with 2 98/50. The same with all other numeric keypad.
    Noah

  • Ole web browser, prevent F8 key from firing

    Hi all,
    I have added an OLE Web Browser control to a window in PB11.2 and load a PDF document.  This works fine.
    But I want to prevent the user from pressing F8/right-clicking within the ole.  Because doing so allows the user to see the adobe reader toolbar (F8) / context-menu (right-click) which allows him to other stuff (save/print) which we dont want the user to do.
    I have been able to prevent the user from right-clicking inside the ole control via the following code (in "other" event):
    IF wparam = 516 THEN
        //disable right-click
        ole_control.POST SetFocus( )
    END IF
    However, am unable to prevent key event from being fired inside the ole control.  Does any one have any ideas/suggestions?
    Thanking you in advance.
    Cheers,

    Hi Roland,
    Thanks for your reply.
    I have decided to stop trying these work arounds (disable right-click, F8, etc)...
    instead, I now generate the pdf (as read-only) by encrypting it thus automatically disabling the save/print/etc functionality from the adobe reader.
    unfortunately, the mail button cannot be disabled (no idea how? why?).  So, I leave it here...
    Best,
    -a

  • How can I remove the "enter" key from the keyboard? (New Macbook)

    I have the last white macbook, I spilled beer in a couple of keys, I managed to removed them without problems, but I can't find the way to remove the Enter Key, and there is no help on internet Anyone?

    What characters are you talking about exactly and why would you want to remove any?
    There is really no way to modify Apple's keyboards or add your own in iOS, but there are some apps that may provide a work around.

  • Using Enter key from numeric keypad to enter and switch to next element in an array control

    Hello all,
    I have a question regarding a simple but annoying problem, of which I did not found a solution yet.
    I have written an application in which I have to enter data manually in a numeric array control.
    If I want to enter the value and go to the next element in the array control, i am forced to use the Tab key on my keyboard, or risk RSI using the mouse.
    How can I assign the Enter key of the numeric keypad section of my keyboard to to the same as the Tab key?
    Kind regards,
    Raymond

    [email protected] wrote:
    Can you convert the example in a image or can you convert in to 8.2.1 version?.
    Best regards
    Saved in 8.2.1 for you.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Change Array Event.vi ‏16 KB

  • Prevent ESC key from closing movie

    Hi!
    Can anyone please advise me how to stop a movie closing when the ESC key is pressed.
    I have a dialog function that opens another movie to confirm quit.
    I would prefer it to minimize instead of simply closing with no warning.
    Many Thanks
    Sarah

    You set 'the exitLock' to TRUE - check the docs for more details. Also, once the exitLock is true, you can implement an 'on closeRequest' handler to detect your using pressing the ESC key, or clicking the close box on the titlebar.

  • Submitting form with Enter key

    Hello,
    in standard html form, when you have form with submit button, the enter key when any form element is selected submits the form.
    This is very convenient for users, so I want this with UIX forms. I know it is possible (I have one form where it is working), but I can't get it working anywhere else.
    This code works:
    <uix:form method="post" name="newRoleForm">
    <uix:inlineMessage prompt="Role name">
    <uix:textInput name="newRoleName" />
    <uix:spacer width="15" />
    <uix:submitButton text="Create" formName="newRoleForm" />
    </uix:inlineMessage>
    <uix:formValue name="jboEvent" value="newRole" />
    </uix:form>
    When I copy this code to another page, it does not work...
    Can somebody help, please?

    I've studied the HTML generated by UIX and it has following bugs and misfeatures:
    1. Misfeature: Submitting with Enter works ONLY if there is exactly one text field in the form (no submit button is actually needed), as Brian Stoler wrote. I don't understand reason for this.
    2. Bug: UIX generates javascript function "_submitOnEnter" which is called as event handler for "onKeyPress" event. But this function is erroneously generated multiple times, once for each form in the page. Browsers (Mozilla and IE) use the latest implementation. This function is different for forms with one text field and for forms with more text field, but only the first one can do the job. As a consequence of this, Enter can submit the form only if the last form on a page has single text field (which is for example not the case of search form with single field above another form...)
    Tested with UIX 2.1.7 in JDeveloper 9.0.3.3, using UIX as JSP tag library.
    Workaround:
    1. Use Opera browser: it submits form with enter key even if there is no submit button (this does not work for the first text field in the form, because it has "onkeypress" event handler).
    2. Implement this feature by hand yourself, if you really need it (see below).
    3. Use accessKey: allows to submit form with Alt+<key> combination (followed by Enter with IE).
    Implementing Enter key submits with Javascript:
    1. Put the following function to the header (or to javascript library):
    function enter(e, frm) {
    var kc;
    if(window.event) kc=window.event.keyCode;
    else if(e) kc=e.which;
    else return true;
    if(kc==13) {
    submitForm(frm,1);
    return false;
    Function copied from UIX (C).
    2. Add this event handler to each input element:
    onKeyPress="return enter(event, 'formName');"
    It is obvious that this is error prone, but it works with all browsers...
    Will this be fixed in future versions?
    Why only form with one text field can be submitted?

  • Is it possible - "pust enter key" and "execute go button"

    Hi guys,
    I want to execute the go button when I push the enter key from keyboard...
    Is it possible?
    Regards.

    hi mate - i think i know what you're trying to do... you're trying to "set focus" on the GO button so on "enter" the go button automatically fires off.
    couple of problems with this (from what i see).
    1. if you have multiple prompts on the dashboard then you have more than one "GO" button to click on... which one should you default to?
    2. targeting the Go button using javascript would be a custom job and burn time, traversing the DOM to find the right "GO" button to set focus on....
    ... if possible I would just say "it can't be done" to the end user... is that an option?

  • Stop Enter key for acting in a JTable

    I am having some problems with scrolling because of the Enter key. I there a way to override or stop the enter key from acting in a JTable?

    The following code simulates a mouse click on a cell when enter is pressed. You should be able to change it to do nothing, or add other functionality.
    table = new JTable(model)
         protected void processKeyEvent(KeyEvent e)
               if ( e.getKeyCode() == KeyEvent.VK_ENTER
               &&   e.getID() == KeyEvent.KEY_PRESSED )
                   int column = table.getSelectedColumn();
                   int row = table.getSelectedRow();
                   Rectangle r = getCellRect(row, column, false);
                   Point p = new Point( r.x, r.y );
                   SwingUtilities.convertPointToScreen(p, table);
                    try
                         Robot robot = new Robot();
                         robot.mouseMove(p.x, p.y );
                         robot.mousePress(InputEvent.BUTTON1_MASK);
                         robot.mouseRelease(InputEvent.BUTTON1_MASK);
                         robot.mousePress(InputEvent.BUTTON1_MASK);
                         robot.mouseRelease(InputEvent.BUTTON1_MASK);
                         robot.mouseMove(0, 0 );
                    catch (Exception e2) {}
               else
                   super.processKeyEvent(e);
    };

  • Clearing the history causes the enter key and search button not to work

    If I clear my history and set my browser to never remember or suggest websites, the search button doesn't work. I can click on it but nothing happens. In addition, if I simply use the enter key from my keyboard, that doesn't work either. I have to reset firefox and then the new version will work (but if I go back and change all my history settings again and then it stops working). Please help.

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • Problem while  capturing keys from keyboard .

    hello abapers,
    i am trying to catch my enter key from keyboard coz i want run some code when user will press enter.
    i think sy-ucomm will capture the key pressed, if i am wrong then plz correct me.
    (1) with this assumption i tried running bdc for my screen and tried to get the bdc_okcode value  which  is /00
         i passed this value to sy-ucomm in my abap prog but it didnt worked
    (2) i tried writting /h in command window it oppend the debugging window but the value for sy-ucomm was blank
    if any one of you is able to correct me it would be of great help to me plz its .....
    Thank you.
    Edited by: Dakshaini A Subramaniam on May 15, 2011 8:36 AM
    Edited by: Rob Burbank on May 15, 2011 4:21 PM

    Hi ,
    Double click your ,
    SET PF-STATUS 'STATUS'.
    code. At Standard Toolbar part of the pf-status  , set OK CODE for first item (green) to 'ENTER'.
    When user hits enter , sy-ucomm will be ENTER.
    This is for screen processing .

Maybe you are looking for

  • Satellite A65 Hard Drive Problem...PleasE Help!

    When I try to boot my computer (Sarellite A65-S126) I get the following message,....It keeps scrolling down my computer. For Realtek Rtl8139(x)/8130/810x PCI Fast Ethernet Controller V2.13 (020326) PXE-E61: Media Test Failure, check cable PXE-M0F Exi

  • Native Format Builder in File Adapter - NXSD:ConditionValue

    Hello, I am trying to build a schema using the Native Format Builder in the File Adapter. I am using the option "Multiple Records of different types" The CSV file will look like the one shown below, the first column will have either DS, Shipping or a

  • Passing column name inside an update query

    Hi, To checking if there any number field present in 'ID' column, I am using the follwing query. UPDATE table1 SET COL1 = 'Y' WHERE 0 = ( SELECT CASE WHEN ID IS NULL THEN 1 WHEN REGEXP_LIKE( ID, '^( *)(\+|-)?((\d*[' || SUBSTR(VALUE,1,1) || ']?\d+)|(\

  • Mass Removal of component from Maintenance Order Component list

    Hi Gurus, I had a long list of material which have been set with deletion flag. With this list, I had remove them from BOM using CS20. Does anyone knows how to remove a component from the maintenance order component list based on that material had se

  • Download of Designer Hangs upon completion

    So that we may better diagnose DOWNLOAD problems, please provide the following information. - Server name download-east.oracle.com - Filename Oracle Designer 6i Release 4.1.1 for Windows Download the Complete Files des6ir411.zip (251,078 kb) - Design