Write a Form (HTML) Write a form to allow a person to subscribe to a magazine. T
ID: 3754703 • Letter: W
Question
Write a Form (HTML)
Write a form to allow a person to subscribe to a magazine. That form should ask for the following information:
Name
Snail Mail Address with separate street, town/city, state, and ZIP code boxes.
Which of the following magazines (can be more than one) the person wants to subscribe to: Newsweek, Time, Sports Illustrated, Internet World (just had to get a related magazine in there :-).
How to pay (bill by mail, pay by credit card online)
If by credit card online, the Credit Card (Visa/MasterCard/Discover), the credit card number, and the expiration date.
Use the CGI alternative mentioned in the Forms module: <form name="donationForm" id="donationForm" action="http://webdevfoundations.net/scripts/formdemo.asp" method="post"> or action="http://www.rebol.com/cgi-bin/test-cgi.cgi" method="post"
Know the difference between a checkbox and a radio button. With checkboxes, you can select one or more items, while a radio button should permit only a single selection.
Test the form before submitting! If nothing shows up in the results page, something is wrong with the form. Check the form again to ensure correctness. If something seems awry and you can't find the problem, post it anyway to see if we can help!
Use a table to align the components of the form and to make it neat.
Tip:
You might create and test the form first to make sure it works, then build the table around it.
Explanation / Answer
<!DOCTYPE html>
<html>
<body>
<!DOCTYPE html>
<html>
<body>
<form name="donationForm" id="donationForm" action="http://webdevfoundations.net/scripts/formdemo.asp" method="post">
Name:<br>
<input type="text" name="name"><br>
Address:<br>
<input type="text" name="adress"><br>
Street:<br>
<input type="text" name="street"><br>
Town:<br>
<input type="text" name="town"><br>
State:<br>
<input type="text" name="state"><br>
Zip Code:<br>
<input type="text" name="zipcode"><br>
Magazine you want to subscribe : <br>
<input type="checkbox" name="Choice1" value="Newsweek"> Newsweek<br>
<input type="checkbox" name="Choice2" value="Time"> Time<br>
<input type="checkbox" name="Choice3" value="Sports Illustrated"> Sports Illustrated<br>
<input type="checkbox" name="Choice4" value="Internet World"> Internet World<br>
Payment Methods: <br>
<input type="radio" name="method1" value="bill by mail"> bill by mail<br>
<input type="radio" name="method2" value="pay by credit card online">pay by credit card online<br>
<select name="charstype" id="charstype" disabled="disabled">
<option>Visa</option>
<option>MasterCard</option>
<option>Discover</option>
</select>
<br>
Credit Card Number:<br>
<input type="text" name="Number"><br>
Expiry date:<br>
<input type="Date" name="Date"><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
</body>
</html>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.