Skip to main content

Radio Buttons in Html Forms

Whenever you want to ask for something that he like you or another suppose so there is 2 option me or else so radio button is used or another point of view say's you accept our terms or not this is the common example of radio button.
Radio Button Code:
<form name="qtutor" action="mailto:pateltutor1@email.com" method="post">
<h4>Please select your favorite Sport.</h4>
<input type="radio" name="sport" /> : Cricket<br />
<input type="radio" name="sport" /> : Football<br />
<input type="radio" name="sport" /> : Volleyball<br />
</form>
Radio Button Example:

Please select your favorite food category.

: Cricket
: Football
: Volleyball
The key thing is the name of radio button if you have multiple radio buttons in forms then take care of the name of radio button suppose in upper example we ask for only sport now we will ask for sport and gender too so keep remember that name is the key of the radio button.
<form name=qtutor" action="mailto:pateltutor1@email.com" method="post">
<h4>Please select your favorite sport.</h4>
<input type="radio" name="sport" /> : Cricket<br />
<input type="radio" name="sport" /> : Football<br />
<input type="radio" name="sport" /> : volleyball<br />
<h4>Please select your gender.</h4>
<input type="radio" name="gender" /> : Male<br />
<input type="radio" name="gender" /> : Female<br />
</form>
Now you see there is a lot of difference between both because the name is change one is sport and other is gender

Comments

Popular posts from this blog

Beginner Html Lesson 2

In the previous lesson we just copy a code and paste it. In this lesson we will guide you through rest of the things what is that let's talk more. We made a webpage with something very weird for beginner don't worry go ahead. <html> : This is the essential thing for any web page and also closing tag </html>. Between these codes we add some more codes <head> </head> , <body> </body> between the body code actually body itself saying that i am body of your webpage. What Head tags containg (<head> </head>) ? Basically head tags contains following <title> <base> <link> <meta> <script> <styles>  What Body tags contains (<body> </body>) ? And a body tags contains anything like your bolded text , your content of any type.Paragraphs , Headings anything. I hope you understand.

Submit Buttons in Html Forms

Submit buttons are use to submit the forms whenever user registration is needed submit buttons always used. How to make those submit buttons? Just simple you can make submit buttons if you know the <input> tag then make it's type= submit value="some name" just like submit, send etc. Submit Buttons Code: <input type="submit" value="Submit" /><br /> <input type="submit" value="Send" /><br /> <input type="submit" value="Submit Form" /><br /> Submit Buttons Example: Submit Buttons in Action Code: <form method="post" action="mailto:pateltutor1@gmail.com" > Name:<input type="text" name="First" size="12 maxlength="12" /> Email:<input type="text" name="Last" size="24" maxlength="24" /> <input type="submit" value="Send Email" /> </form> ...

Reset Buttons in Html Forms

Reset Buttons: Reset buttons are use to reset the forms in Html. Sometime users put wrong information then the users don't be worry of removing whole the fields and fill them again just press the reset button and whole the form back to their original state. That's very useful for the user. Html Code: <input type="reset" value="Reset" /> <input type="reset" value="Start Over" /> Html Code: Reset Button in Action: Now we are giving some action for your understanding what reset button done don't panic we give some form tags and other just visit Forms in Html you will also learn how to make it. Reset Button Code: <form action="xyz.php" method="post"> First Name: <input type="text" size="20" maxlength="12" /><br /> Last Name: <input type="text" size="24" maxlength="24" /><br /> <input type="reset" value=...