Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7402773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:50:48+00:00 2026-05-29T04:50:48+00:00

Because we use orbeon xforms, we don’t know the id of the button tag.

  • 0

Because we use orbeon xforms, we don’t know the id of the button tag.
What we would like is the Enter key to trigger a button that contains a certain string value.

If my form contains a Check button like so:

<button id"random">Check</button>

I would like my javascript button to trigger it with something like:
find the button that has value “Check” and click it when Enter is pressed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T04:50:54+00:00Added an answer on May 29, 2026 at 4:50 am

    Updated code, since I didn’t see your markup (which contained <button> instead of <input>)

    I would use JQuery here since selecting the buttons you are looking for could be more difficult using Pure JS only.

    Something like this should work:

    $(
        function(){
            $(document).keydown(function(){
                 if (event.keyCode == '13') {
                     event.preventDefault();//stop what normally happens..
                     //..like submitting a form maybe
                     //$("input[type='submit'][value='Check']").click();
                     $("button").each(function(i){
                      if($(this).text() == "Check")
                      {
                         $(this).click();
                      }
                     })
                 }
            });
        }
    );
    

    With markup like this:

    <button id="random" onclick="alert('clicked 0');">Check</button>
    <button id="random2" onclick="alert('clicked 1');">Something else</button>
    <button id="random3" onclick="alert('clicked 2');">Third Button</button>
    

    See Demo : http://jsfiddle.net/giddygeek/Caxae/3/
    (Click/Focus on the result pane and hit the Enter key)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't want to use mailto: because I personally find it annoying when it
I am developing an application that needs to use regini (because of legacy reasons)
Mobile browsers. Jquery dialog alert box. I don't want to use alert() because it
My guess is that it shouln't have because they use centuries also in dates
I have an app that take long time to deploy/redeploy because this use EJB3,
First I'm not mad, because I use MVVM in WinForms-) I know about MVP
I would like to use a post/pre-commit hook to fill the fixed bug field
Is there anything but Assetic (which I cannot use because of PHP version) that
I implement IDuplexSessionChannel on my Custom Channel because I use tcpTransport. In that custom
I have a mySQL wildcard query that isn't working probably because I use InnoDB

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.