HTMLHTML TutorialHTML Codes/Generators
HTML Background Code
HTML TagsHTML Color HTML Color Chart HTML Comment Box Code HTML Scrollbox Code HTML Text Code HTML Image Code HTML Marquee Code HTML Music Code HTML Video Code HTML Form Code HTML Frames Code HTML Entities HTML Examples HTML Help/Cheat Sheet HTML Templates More Codes... HTML Generator HTML Table Generator Marquee Generator Music Code Generator HTML Text Generator Text Box Generator MySpace Generators More Generators... HTML 5 Tags Create a Website |
HTML Radio ButtonThis page contains code for creating an HTML radio button. It also provides an explanation of radio buttons. Feel free to copy and paste the code into your own website or blog. You create a radio button with the HTML Anyway, here is the code and some information on creating a radio button. Basic Radio ButtonThis example uses the Example: Code: You will notice that, although all radio buttons had different values (i.e. within the Groups of Radio ButtonsHere are two groups of radio buttons. Notice once again that the radio buttons in each group shares the name. The first group has a name of "preferred_color" and the second group has a name of "preferred_item". Example: Code: Important points to note about radio buttons:
Understanding Radio ButtonsWhen you first learn how to create a radio button, you may find it a little difficult to understand how the The whole purpose of a radio button is to enable the user to make one selection - and one only - from a list. If you wanted the user to make multiple selections, you wouldn't use a radio button - you'd use a checkbox. Anyway, because the user can only make one selection from our group of radio buttons, all radio buttons in that group need to share the same name. This is how we group the list together - they all share the same name. This tells the form handler the name of the group, and the value of the selected radio button. For example, if you want users to choose between a group of colors, you would create a radio button for each color. You would give all radio buttons the same So, let's say a user submits a form that sends an email to the webmaster. The user selects their preferred color from a radio button and clicks the submit button. The webmaster might receive an email that looks like this: A user has selected a preferred color from your web form. Here is the result: Preferred_color: Red I'm sure you could think of better things to do than to simply ask for your users' favorite color, but hopefully you get the idea! In this case, the form handler (i.e. a server-side script), has processed the form and emailed the name of the group (Preferred_color), and the value that was selected (Red). |
Need Website Content?
Get unique, quality digital content for your website.
|