Capturing enter button in JSF

Hi ,
I am using JSF with tomahawk in my application.
I have a form with one textfield and one submit button.
I am using tomahawk and javascript to populate a hidden textfield.
My problem is that when the user types in something int eh textfield and presses the "enter" key instead of the submit button, the form doesn't get submitted and is not populating the hidden field.
Because of this when we later hit the submit button, it still has a problem.
What is the work around for this?
Is there away to capture the enter key and submit the form or is there a better way to do this?

Define your form with a on key press event:
<h:form id="yourForm" onkeypress="if (event.keyCode == 13) {javascript:submitForm(); return false;}; return true;">The javascript function is:
function submitForm(){
     if (event.keyCode == 13){
          document.getElementById('yourForm:submitButtonId').click();
          return false;
     return true;
}submitButtonId is the id of the button that needs to be triggered when you press enter key. Hope this should solve your problem.
SirG

Similar Messages

  • How to get function code of enter button in bdc manually

    hi
    i need to know how to get function code of enter button in bdc manually like in screen i want to capture techincal infor of enter buttion and itd fucntion cod ehow can i get it i mean what is the key in keyboard to display that
    i want to capture enter button and for eg status button etc funtion code
    pls suggest
    arora

    Hi,
    Want you need to do is go to transaction SHDB and record the bdc for the transaction you want, during transaction press the buttons for which you want the bdc code. And after this go press the back button and check the list of all the things recorded in Recorder.
    And for SHDB help check this link:
    http://abaplovers.blogspot.com/2008/02/recording-bdc-using-transaction-shdb.html
    Hope this helps.
    Regards,
    Qamar.

  • Where is the ENTER Button on the P1606dn when I am trying to manually feed envelopes?

    I had trouble trying to print envelopes using Microsoft Word running under Windows 7, I got an HP message saying to load the paper (envelope) then hit the ENTER button.
    Hitting the enter button on my keyboard did not get the intended results. Looking at all documentation on the P1606dn printer did not find a button labeled as an ENTER button there.
    I finally discovered the proper button is the "GO" button depicted by a sheet of paper with a folded-down upper right-hand corner and an arrow pointing downward on the top of the printer.
    It would be nice is HP were to change the drivers to where the message would be consistent with the documentation of the printer.

    Thank you for your message and feedback.
    You are right. the intention is to educate customer to hit the "GO" button.
    I am an employee of HP but I only speak for myself and not for the company.

  • Dynamic Action with KeyCode check for ENTER button pressed

    Hi,
    I want to create a dynamic action which executes if the ENTER button of field P1_NAME is pressed.
    I thought about this type of DA:
    Event: Key Press
    Selection Type: Item(s)
    Item(s): P1_NAME
    Condition: Javascript expression
    Value: this.triggeringElement.keyCode == 13
    That unfortunately doesn't work! Dynamic action doesn't get executed...
    Hope for help! :)
    Tobias

    I found the solution in my own blog: :)
    Event: Key Press
    Selection Type: Item(s)
    Item(s): P1_NAME
    Condition: Javascript expression
    Value: this.browserEvent.keyCode == 13

  • Add An Enter Button To a Preloader

    On my site I have 2 scenes and I'd like to add an 'Enter' button for moving from the preloader to the main site. How would I do that in this code?
    stop();
    preloader._width = 0;
    preloader._visible = preloader_bg._visible = true;
    preloader.onEnterFrame = function()
        filesize_total = _root.getBytesTotal();
        if( filesize_total == 0 ) filesize_total = 1;
        percent = Math.round( _root.getBytesLoaded() / filesize_total * 100 );
        txt = percent + "%";
        preloader._width = percent * 3;
        if( percent == 99 )
            delete this.onEnterFrame;}
    enter_btn.onPress
         gotoAndPlay("flashmo_dream", "start");

    I don't know where you are getting these tutorials, but they sound like they are very, very old. Along with not using AS2, you shouldn't be using scenes. Scenes are a left over method from the very earliest versions of Flash.
    The objective in preloading content is that you are loading in new content before the user needs it. If you are doing this loading well, the user will not know that the operation went on. Any sort of loading screen should only be seen if the user calls for content that has not loaded yet. Your design objective should be to show something to the user as quickly as possible when the user hits your site. Load in your additional content and then let the user experience your site.
    If you create a button on the stage in the same frame as your preloader object and name that button "enter_btn", then the code that you've shown above should do what you want.
    I haven't used AS2 in many years. I don't remember a lot about its syntax, but from what I read of your code, it looks like you are measuring the loading of the file that contains the preloader object. This methodology can lead to a problem. When Flash begins working, a certain amount of the movie has to load before anything is seen on the screen. This means that the loading telltale that you have set up in your code will never show "0%", and probably not even "50%".
    Here's a good tutorial that uses AS3 and fully explains the code and how the loader operates: http://flashexplained.com/preloaders/basic-loading-bar-preloader/
    Here's another: http://www.republicofcode.com/tutorials/flash/as3preloader/
    And here's a third: http://flashexplained.com/preloaders/making-the-complete-internal-preloader-in-flash-8-wit h-a-loading-bar-and-mathematical-preloaders/
    Take a look at those examples and compare and contrast their methods.

  • Sy-ucomm problem when hitting enter button

    Hello all,
    I am implementing a user exit for CO11N screen and i want the control after hitting save button so i made a control for sy-ucomm and i gave an error message. But when i hit enter button after this error message, sy-ucomm still equal to BU so it gives error message again. How can i prevent this?
    Thanks.

    Im not creating blank message
    i use the a term but the problem is, when i first hit save button and see the error message,than  i hit enter button to pass the message and make the input fields editable again. But sy-ucomm is still equal to BU so it show the message again and again and i cant return to normal input screen. And if i make the message type 'S' i cant block the saving process.
    I have to option first i will use type E message but i have to get over the problem above, or i will use type 'S' message but i have to stop the transaction after this message. I used type E like S or type S like E. They didnt work.

  • How to "enter" a text field on a website that doesn't have an enter button?

    Hi All,
    I wanted to know I can press "enter" in a text field on a website that doesn't have an enter button.
    I have used the following to help me code (i.e. login, enter values into fields).
    https://decibel.ni.com/content/docs/DOC-25396
    The above link helps but there isn't a submit on the website I am trying to access or in the code.
    What has worked for me, but isn't the best solution, is to simulate a mouse click on the desired field, after text entry, then simulate the keyboard "pressing enter".  The problem with this is the mouse click depends on the position of the labview front panel. The code runs in the background and is also a subvi.
    thanks in advance,
    Jose

    Just a question/idea - but can you not just POST the data to the web server directly? Take a look at the HTML of the page and see if you can find the <form action="<THE URL TO POST TO>"> and then find all of the names of the form fields and send them along with the values via the HTTP Client POST VI.
    It sounded to me like you are trying to push data into a web server so it shouldn't be necessary to render the page and fill out the fields on the rendered page if you can bypass all that and just submit the data and get the response.
    If the form data is sent asynchronously (using AJAX), then you might need to delve a little into the site's javascript to find the POST URL and field names.
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • Can't load any websites. I do not get any "error messages", the "enter" button has no effect in the address bar. Works fine in the FF search box and in IE.

    Entering a URL in the address bar and hitting enter does nothing. Neither the "enter" button or "address bar arrow", for going to the website, function. Website does not load and no error messages appear. "Enter" button works fine in the FF search box and in IE, so it's not my keyboard.
    Tried most of the recommended fixes under the "Error loading websites" article with the exception of "DNS refetching", as typing "about:config" in the location bar does no good as the "enter button" won't function. I've removed and re-added FF back into the windows firewall, removed ZoneAlarm from my system, edited proxy settings, deleted and reinstalled FF several times. NOTHING WORKS!!! I'm a die hard FF fan and this is KILLING me. Please HELP!!!

    You have a lot of information in packed in the "More system details..." (in the right-hand column), where it looks like you found a solution. If not take a look at "Problematic Extensions" the AVG Free installation of their "'''AVG Free Search'''" can cause such problems. Directions to fix that are specific and involve reinstalling AVG Free without the Link Scanner component.
    * http://kb.mozillazine.org/Problematic_extensions

  • I want to execute selection screen by pressing enter button

    Hi,
    I have a requirement like after giveing values in selection screen I want to execute it by pressing enter button not by pressing execute button.
    Please give some sample code if u have any solution.
    Thanks & Regards
    Venkatrami Reddy B

    Hi,
    You can achive this.
    You just need to do all your coding under even AT SELECTION-SCREEN OUTPUT.
    But you have to put a check also say counter.
    Define a variable of type integer and then put the check on the mail block of code (whole program eccept selection screen) as mentioned below.
    IF lv_count > 1.
    program lines..
    ENDIF.
    lv_count = lv_count + 1.
    Regards,
    Raj Gupta

  • Pages not loading after pressing the enter button

    when i write some adress into the navigation panel and press enter nothing happens. Pages doesn`t start to load even from the history. Only thing that works are bookmarks, they load on, and I can browse the internet from the sites. By the way, the enter button works in other programs well. Thanks for ideas

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration 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

  • How can I change the behavior of the Green Enter button when filling out a field in a form? Current it submits the entire form, I would like it to tab to the next field instead

    When using Firefox for Andriod:
    When filling out a field on a form, they keyboard has a Green Enter button that submits the entire form. However, there are multiple fields on the page, and I would like it to tab to the next field. At the very least not submit the form.
    Also, is there a way to configure the keyboard that shows up for each html5 input type?

    They keyboard that shows up has the large "Green Enter" go button, a backspace and some arrow keys, but no tab button.

  • My enter button and web search orb won't work only on my homepage. Works everywhere but there. We have Yahoo for a homepage. What should I do?

    We have the at&t/yahoo homepage fixed where we can check our other email account. On this page, I have just a color theme and all of the news items disabled. We have had this for three years now. Just a few days ago we noticed that when we use the search bar that is included in the middle of the page that the enter button won't work. I usually type and hit enter as opposed to clicking on the mouse button. I do have the search assistant on. I tried to disable that, but it didn't help. I have a couple of other search toolbars and they work fine with the keyboard. It's just convenient especially for my husband to have it this way. I have searched the internet for several days and have come close to what I thought would be the answer but nothing has worked yet. Most of the questions/answers were old anyway. It might not have anything to do with Firefox, I just didn't know where else to ask questions too.

    Also, when I go on to safari, another alert pops up that safari cannot verify the identity of the website, anything that I type in to as common as google.com. It gives me 3 options to either cancel, look at details, and continue. I've looked at the details of the website of Google and it is legitimate the site. Any help?

  • I'm having problem with text boxes.  Whenever i hit the enter button to start a new line or paragraph, the cursor doesn't drop down to the next line.  Instead i get this little red + sign in the box.

    I'm having problem with text boxes.  Whenever i hit the enter button to start a new line or paragraph, the cursor doesn't drop down to the next line.  Instead i get this little red + sign in the box.

    You are absolutely right.  Thought Enter meant Enter.  I was wrong.  Thank you for the help.
    Rod Rogers, Broker
    Accredited Land Consultant (ALC)
    Metcalf Land Company, Inc.
    Office: 864-585-0444
    Mobile: 864-316-0297
    Fax: 864-583-6000
    <http://www.metcalfland.com> www.metcalfland.com

  • How to fill out the clipboard under "about:support" when enter button does not work in address bar? Thearrow button does not work either?

    My enter btton does not work in the address bar or search engine. I have done the restart in safe mode...deleted and reinstalled firefox...done the malware/adware checks...still no improvement.
    I was asked to do the "about:support" then click enter for the clipboard to paste the system notes into. That is not an option however because the orginal problem is the enter button not working. Ideas?

    Create a new profile as a test to check if your current profile is causing the problem.
    See "Creating a profile":
    *https://support.mozilla.org/kb/profile-manager-create-and-remove-firefox-profiles
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Profile_issues
    If the new profile works then you can transfer files from a previously used profile to the new profile, but be cautious not to copy corrupted files to avoid carrying over problems.
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • Code  for  'enter' button in user command.

    hi experts,
                       i have developed a initial screen as selection screen for table control.
    data is displayed in second screen(table control).
    <b></b>when user enters inputs in selection screen and presses enter on keyboard
    it should execute to second screen. code for enter button. <b></b>

    Hello,
    in the PBO process should you have the next code:
    for example:
    case sy-ucomm.
    when 'ENTER'.
        CALL SCREEN 0200. " The second window
    when 'SAVE'.
    when ...
    endcase.
    You should have all conditions in the case statement, otherwise you have a error.
    Regards,

Maybe you are looking for