Tip Details Add a Related Tip

Rate as: Positive Negative

Submitting web forms without buttons

Many newer web browsers are starting to ignore the CSS directives related to buttons on web page forms. While this does lead to a more consistent look and feel on the desktop, ignoring the CSS and create system-type buttons can really mess up the look of a web page that is trying to create a consistent them.

As a result of this, many web designers are doing away with buttons on their forms altogether. Instead they use links (hrefs) inside of a div or a span element and they then style the div or span element to look like a button. This way the form will look consistent across all browsers.

The one problem with this approach is that if there are no buttons for the form, the user can no longer press the Enter key on the keyboard to submit the form. A lot of people don't like this since they then have to go from the keyboard to the mouse to submit the form.

If you are running into this problem on your web pages, there is a nice little fix you can use that will allow you to control the look of the buttons while keeping the form submission via the Enter key working. You can do this by adding a simple button of type submit to your form and then styling the button so that it is not visible. It won't affect your look at all. And since the browser thinks that there is a submit button in the form, hitting the Enter key will still work. Here's some code snippets as to how this looks...

...

<style type="text/css">
   button.hiddenSubmit {
      visibility: hidden;
   }
</style>

...

<form ...>

...

   <button type="submit" class="hiddenSubmit"></button>

...

</form>

...

Doing this will allow you to fully control the style of your buttons while leaving the page so that the user can hit the Enter key to submit the form.
Rating: 100% positive, 1 Vote
Categories: web design web development programming HTML CSS
Added: on Aug 06, 2008 at 8:16 am
Added By: an anonymous user
Searches: form button web css submit

Comments on this Tip

Add a Comment
This works in Firefox and Safari, but not in IE7. I don't know about IE6.
– Added by an anonymous user on Aug 06, 2008 at 1:26 pm
Your Comment:
(how to format)
Rate This Tip:

Verify Humanity:
Sorry, we know it's annoying, but please enter the characters shown in the image to the left so that we know you're an actual person and not an evil spammer. Thanks.
       

Related Tips

CSS3 Color Names

100% positive, 0 comments
– Tip added by codenique.com on Apr 14, 2009 at 4:18 am

22 Really Web Safe Colors

100% positive, 0 comments
– Tip added by codenique.com on Apr 20, 2009 at 12:16 pm

Web Color Basics

100% positive, 0 comments
– Tip added by codenique.com on Apr 15, 2009 at 6:14 am

How to Send E-Mail in PHP: A “Share This” Form

33% positive, 0 comments
– Tip added by Walkere on Feb 06, 2008 at 6:45 pm

Telling when an iframe is done loading

85% positive, 3 comments - last added on May 16, 2009 at 7:48 am
– Tip added by an anonymous user on Apr 18, 2008 at 8:05 am

Getting pages to render correctly in IE8

Categories: IE8 web css javascript HTML
100% positive, 0 comments
– Tip added by an anonymous user on Jul 23, 2009 at 10:13 pm

CSS Image Sprites Tutorial - Save Bandwidth Using Better Buttons

Categories: web CSS HTML design
100% positive, 0 comments
– Tip added by an anonymous user on Dec 03, 2008 at 2:08 pm

empty table cells in IE6

Categories: HTML CSS IE6
50% positive, 1 comment - last added on Oct 30, 2009 at 7:34 am
– Tip added by an anonymous user on Nov 11, 2008 at 12:24 pm

Best Font Size for Web Design

Categories: web design fonts css
100% positive, 0 comments
– Tip added by an anonymous user on Oct 24, 2008 at 2:13 am

Learn By Doing

100% positive, 1 comment - last added on Oct 25, 2008 at 12:28 pm
– Tip added by an anonymous user on Aug 25, 2008 at 2:00 am

Use firebug to debug or just make sense of complex sites

100% positive, 0 comments
– Tip added by an anonymous user on May 23, 2008 at 8:41 am

Our best moment was the sunset...

50% positive, 1 comment - last added on Apr 02, 2008 at 5:56 pm
– Tip added by Billy Cenea on Apr 02, 2008 at 5:49 pm

CSS template from scratch

Categories: CSS web design
no ratings, 0 comments
– Tip added by an anonymous user on Aug 21, 2009 at 9:53 pm

CSS Backgrounds Properties

no ratings, 0 comments
– Tip added by learnhtmlonline on Aug 10, 2009 at 2:06 pm

what is the benefit of get a quote

no ratings, 0 comments
– Tip added by an anonymous user on Jul 13, 2009 at 5:57 am

Viewing CSS and Javascript source in Firefox

Categories: firefox javascript CSS HTML
no ratings, 0 comments
– Tip added by an anonymous user on Dec 15, 2008 at 10:04 am

Create your own customized wordpress theme

no ratings, 0 comments
– Tip added by an anonymous user on Nov 17, 2008 at 10:56 am

Find unused CSS in your style sheets

Categories: CSS coding web design free
no ratings, 0 comments
– Tip added by an anonymous user on Jul 14, 2008 at 10:43 am

E-Commerce Web Site Development, London, UK

no ratings, 0 comments
– Tip added by obsgroup on Jun 12, 2008 at 5:15 am

CakePHP: Working with Associations

no ratings, 0 comments
– Tip added by an anonymous user on May 08, 2008 at 4:09 am