How to Build a Submit Button for Your HTML5 and CSS3 Based Web Pages

By Andy Harris

Submit buttons are usually used in server-side programming. In this form of HTML5 programming, the code is on the web server. You can use PHP to create server-side code. The tag is used to make a Submit button, too!

 <input type = "submit" />

Although they look the same, the Submit button is different than the ordinary button in a couple subtle ways:

  • The attribute is optional. If you leave it out, the button displays Submit Query. Of course, you can change it to anything you want, and this becomes the caption of the Submit button.

  • Clicking it causes a link. This type of button is meant for server-side programming. When you click the button, all the information in the form is gathered and sent to some other page on the web.

  • Right now, it goes nowhere. When you set the form’s attribute to null ( ), you told the Submit button to just reload the current page. When you figure out real server-side programming, you change the form’s attribute to a program that works with the data.

  • Submit buttons aren’t for client-side. Although you can attach an event to the Submit button (just like the regular Input button), the linking behavior often causes problems. Use regular Input buttons for client-side and Submit buttons for server-side.