Software, your way.
How To Get Good Custom Software
(Download)
(PDF)
burger menu icon
WillMaster

WillMaster > LibraryManaging Website Forms

FREE! Coding tips, tricks, and treasures.

Possibilities weekly ezine

Get the weekly email website developers read:

 

Your email address

name@example.com
YES! Send Possibilities every week!

Floating Form Submit Button

The easier a form is to use, the less likely it is to be abandoned.

For long forms, forms that may require scrolling in desktop browsers or mobile devices, "easier" can be when the form submit button is always available in the current view. It's also a user-friendly gesture.

Even if all fields are required, the form user may scroll up to verify an item just before submitting. When the submit button follows, the user doesn't have to scroll back down again to submit the form.

A caveat: The submit button must be out of the way — on any size screen. If the button overlaps a field that needs to be filled in, and the user has to move the form up or down to clear the field, then the floating submit button didn't make it easier to use the form, but more difficult.

Implementation

One way to implement it is to put the submit button into a div and give the div a CSS position:fixed; declaration.

Fix the position of the div containing the button with CSS top, right, bottom, or left properties. Examples:

  • top:0; left:0; fixes the position of the submit button at the top-left corner of the browser window.

  • top:1in; left:0; fixes the position of the submit button an inch from the top of the window at the left side of the browser window.

  • bottom:5px; right:5px; fixes the position of the submit button 5 pixels away from the bottom-right corner of the browser window.

It's possible to keep the submit button at it's expected location so form users can find it easily, and have a second submit button floating at a fixed position in the browser window. The two buttons may optionally contain different text or have different designs.

Demonstration

An "Example" submit button is floating at the left edge of the window near the bottom.

Here's how a form might look. (This is a short form. The floating submit button generally would be implemented only for long forms.)

Name:

Email:

For reference, this is the code used for the demonstration, including the border around the form.

<div style="display:table; margin:0 auto; padding:10px; border:1px solid black; border-radius:3px;">
<form method="get" onsubmit="alert('Just a demo, not live.'); return false" style="margin:0;">
<p style="margin-top:0;">
Name:<br><input type="text" style="width:200px;">
</p>
<p>
Email:<br><input type="email" style="width:200px;">
</p>
<p style="margin-bottom:0;">
<input type="submit" value="Submit the Form" style="width:200px;">
</p>
<div style="position:fixed; bottom:.5in; left:0;"><input type="submit" value="Example"></div>
</form>
</div>

For the floating submit button, the field may be type="image" instead of type="submit". A small image may be more out of the way than a normal submit button.

Offering a floating submit button can make a long form easier for your site visitors to use.

(This article first appeared in Possibilities ezine.)

Will Bontrager

Was this article helpful to you?
(anonymous form)

Support This Website

Some of our support is from people like you who see the value of all that's offered for FREE at this website.

"Yes, let me contribute."

Amount (USD):

Tap to Choose
Contribution
Method

All information in WillMaster Library articles is presented AS-IS.

We only suggest and recommend what we believe is of value. As remuneration for the time and research involved to provide quality links, we generally use affiliate links when we can. Whenever we link to something not our own, you should assume they are affiliate links or that we benefit in some way.

How Can We Help You? balloons
How Can We Help You?
bullet Custom Programming
bullet Ready-Made Software
bullet Technical Support
bullet Possibilities Newsletter
bullet Website "How-To" Info
bullet Useful Information List
software index page

© 1998-2001 William and Mari Bontrager
© 2001-2011 Bontrager Connection, LLC
© 2011-2024 Will Bontrager Software LLC