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 3800676
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:55:49+00:00 2026-05-19T13:55:49+00:00

This question is somehow similar to this one . I have a form in

  • 0

This question is somehow similar to this one.

I have a form in my ecommerce solution. When you insert something into the cart, you can change number of items. The cart is whole in one form. The form has two submit buttons – recalcualte and continue (which will take buyer to Step 2 of the process).


When user changes the number of items using the inputs, he can either hit recalculate (which sends post to app that will change the numbers in session/db) or continue (that will also send the post data to recalculate and then take user to the step 2).

But when user hits enter, the recalculate button takes precedence.

What I want is to make the recalculate button submit the form, but ONLY when clicked and NOT when submited by pressing enter. In contrast the “continue” button should work also with enter.

The solution MUST NOT use javascript as the frontend has to be useable without JS enabled.

Any ideas?

  • 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-19T13:55:49+00:00Added an answer on May 19, 2026 at 1:55 pm

    Put the button that takes precedence first in your html sourcecode, and use markup to invert the position of the two buttons?

    Edit: you say your layout can’t handle that.

    Either:
    1. Change the layout. Functionality is more important, and for layout there is more than one way to do it.
    2. Have the form not check if “recalculate” or “submit” was pressed, but rather if the shown price was correct with the calculated prize. Example:

    User buys 1 item, value 3 dollar.
    User buys 2 items, value 5 dollar.
    Total prize: 13 dollar.

    User now changes the 1 item into 4 items. 3 dollar becomes 12 dollar, but he doesn’t hit recalculate.

    Have a field in your form that shows the total amount (a hidden field is nicest). When the user submits the form, redo the calculation. If the calculated prize equals the prize in the hidden field, the user knew the final correct prize. If it differs, reshow the form mentioning “You changed your shopping cart, the total prize has been updated to reflect these changes. Verify the amount and submit to purchase” or something.

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

Sidebar

Related Questions

This question is similar to this one How do I add options to a
I've seen other questions very similar to this but somehow I still can't get
I have a Python code similar to this one: for lines in zip(*files): #
This question sounds similar to many posed here, but it's obnoxiously different. I have
Before I post this question, I found somehow similar question posted here . But
This question somehow addresses the problem, but not from the side I'm looking for.
This is somehow related to my question Why is ''>0 True in Python? In
This question might be naive as I'm new to ColdFusion programming. I have a
This question is related with one of my earlier questions.. Previous Post In there
My problem is very similar to this question , however I am posting a

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.