HTML5 and CSS3 All-in-One For Dummies
Book image
Explore Book Buy On Amazon

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.

About This Article

This article is from the book:

About the book author:

Andy Harris taught himself programming because it was fun. Today he teaches computer science, game development, and web programming at the university level; is a technology consultant for the state of Indiana; has helped people with disabilities to form their own web development companies; and works with families who wish to teach computing at home.

This article can be found in the category: