Sunday, 2 September 2012

Radio and submit buttons in forms HTML code with Example

Example:
Preferred Color:
Red
Blue
Green
Preferred Item:
Car
House
Coffee Machine
 

HTML code:
<form action="" method="get">
<b>Preferred Color:</b>
<input name="preferred_color" type="radio" value="Red" /> Red
<input name="preferred_color" type="radio" value="Blue" /> Blue
<input name="preferred_color" type="radio" value="Green" /> Green
<b>Preferred Item:</b>
<input name="preferred_item" type="radio" value="Car" /> Car
<input name="preferred_item" type="radio" value="House" /> House
<input name="preferred_item" type="radio" value="Coffee Machine" /> Coffee Machine
<input type="submit" value="Submit" /> </form>

No comments:

Post a Comment