Home

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

|
Updated:  
2016-03-26 13:17:12
|
HTML5 and CSS3 All-in-One For Dummies
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 earned a degree in Special Education from Indiana University/Purdue University–Indianapolis (IUPUI). He taught young adults with severe disabilities for several years. He also taught himself enough computer programming to support his teaching habit with freelance programming.
Those were the exciting days when computers started to have hard drives, and some computers connected to each other with arcane protocols. He taught programming in those days because it was fun.
Eventually, Andy decided to teach computer science full time, and he still teaches at IUPUI. He lectures in the applied computing program and runs the streaming media lab. He also teaches classes in whatever programming language is in demand at the time. He has developed a large number of online video-based courses and international distance education projects.
Andy has written several books on various computing topics and languages including Java, C#, mobile computing, JavaScript, and PHP/MySQL.
Andy welcomes comments and suggestions about his books. He can be reached at [email protected].