Programming Examples
Write a HTML program to create a form for the subscription of a magazine
Write a HTML program to create a form for the subscription of a magazine. The form should contain Name, Address, City, State, Pin Code. Magazine should be selected from 5 different magazines using checkbox. Subscription is available for 1 year or two years. Radio buttons shall be used to select subscription period. The page should have a submit button.
Solution
<!doctype html>
<html>
<heaD>
</head>
<body>
<form>
<h3 align="center"> Magazine Subscription Form</h3>
<table align="center" cellpadding="5px" border="1" cellspacing="0" width="40%">
<tr>
<td>Name</td>
<td><input type="text" placeholder="Enter Name"/></td>
</tr>
<tr>
<td>Address</td>
<td><textarea></textarea></td>
</tr>
<tr>
<td>City</td>
<td><input type="text" placeholder="Enter City"/></td>
</tr>
<tr>
<td>State</td>
<td><input type="text" placeholder="Enter State"/></td>
</tr>
<tr>
<td>Pin Code</td>
<td><input type="text" placeholder="Enter Pin"/></td>
</tr>
<tr>
<td valign="top">Select Magazine</td>
<td>
<input type="checkbox"/><label>Magazine A</label><br/>
<input type="checkbox"/><label>Magazine B</label><br/>
<input type="checkbox"/><label>Magazine C</label><br/>
<input type="checkbox"/><label>Magazine D</label><br/>
<input type="checkbox"/><label>Magazine E</label>
</td>
</tr>
<tr>
<td valign="top">Subscription Period</td>
<td>
<input type="radio" name="period" value="1"/><label>1 Year</label><br/>
<input type="radio" name="period" value="2"/><label>2 Year</label>
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Submit"/></td>
</tr>
</table>
</form>
</body>
</html>
Output/ Explanation: