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

  • Home
  • SEARCH
  • 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 138163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:13:14+00:00 2026-05-11T07:13:14+00:00

I have a wizard-style HTML form with a row of submit buttons for the

  • 0

I have a wizard-style HTML form with a row of submit buttons for the Back/Next/Cancel actions (in that order). The form can also contain a varying number of input fields, such as text fields, radio buttons, checkboxes, dropdowns (select tags), and textareas. The customer requires the ‘Next’ button to be the default action, so that if the user types into a text field and presses Enter, it should submit the form as if they had clicked the ‘Next’ button.

The problem is that in this scenario, the browser (at least IE, which is what 99% of our customers use) submits the form using the first button declared in the form, which as you can see from the above list is ‘Back’, not ‘Next’ as desired.

One fix I read about is to declare the Back and Next buttons in reverse order (i.e. Next first) then use CSS to display them around the right way, like so:

<html>   <head>     <style type='text/css'>       .formSubmitButtons {         direction: rtl;         float: left;       }       .formSubmitButtons input {         direction: ltr;         float: none;       }     </style>   </head>   <body>     <form action='blah' method='POST' enctype='application/x-www-form-urlencoded'>       <div class='formSubmitButtons'>         <input type='submit' name='btnNext' value='Next'>         <input type='submit' name='btnBack' value='Back'>       </div>       <input type='submit' name='btnCancel' value='Cancel'>       <br/>Some text fields go here...     </form>   </body> </html> 

This provides the desired behaviour and button order in both Firefox and IE, however the spacing of the Cancel button relative to the others is inconsistent. In IE6 it looks nice enough, but in Firefox 3.0.5, the Cancel button is jammed up against the Next button.

Does anyone know what CSS magic I need to weave in order to get these three buttons to space evenly in both browsers?

(avoiding the issue by sorting the buttons Next/Back/Cancel is not an option)

(also thanks to everyone who suggested JavaScript-based solutions, but not all our customers allow JS, so it has to be a straight HTML and/or CSS solution)

Here’s what I ended up doing that worked nicely (based on Cletus’s suggestion):

<!-- <input type='submit' name='btnNext' style='position: absolute; left: -9999px' tabindex='-1'> <input type='submit' name='btnBack' value='Back'> <input type='submit' name='btnNext' value='Next'> <input type='submit' name='btnCancel' value='Cancel'> --> 

(ignore the wrapping comment tags, they’re just so you can see the HTML)

  • 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. 2026-05-11T07:13:15+00:00Added an answer on May 11, 2026 at 7:13 am

    Have you considered using this trick? Basically you just have a hidden button appear first which does the desired action.

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

Sidebar

Related Questions

We have several wizard style form applications on our website where we capture information
I have a wizard in my app where users can go back and forward
I want to have my form in a wizard style and so I used
I'm using the jQuery form wizard plugin. I have 20 questions that each have
can somebody explain me, how to do wizard-style forms with validations? f.e.: i have
I have an app that I'm writing a little wizard for. It automated a
I have a form with following fields.While click on submit button I am getting
I'm doing a multi step form (form wizard) and I have splitted the form
I'm creating a multi-part form in the style that Ryan Bates describes here: http://railscasts.com/episodes/217-multistep-forms
I have a form called wizard. Everytime any input element is changed, I want

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.