Girl Scout Cookies The Girl Scouts of America have hired you to design a page fo
ID: 3711024 • Letter: G
Question
Girl Scout Cookies
The Girl Scouts of America have hired you to design a page for ordering their cookies. Your page should gather all pertinent order information from a user and display the order results back.
Section I receive
Create a form that has several sections. The first section, entitled “Account Info” should gather first name, last name, street address, city, state, and 5 digit zip code. Each input should have its own textbox and label. For state and zip code, the size of the textbox should be appropriate for the amount of characters it will hold. This section should also contain 2 radio buttons. The first button should read: “Use address for shipping”. The second button should read: “Use separate shipping address. If the user selects the first radio button, the fields in the shipping section should be populated with the address information in this section. If the second radio button is selected, the fields in the shipping address should be cleared.
Section II
Create an additional section in the form entitled “Shipping Information”. Gather street address, city, state, and 5 digit zip code.
Section III
Create a third section entitled “Cookies”. This section should contain 2 labels, a checkbox, and a textbox for each of the 5 different types of cookies: receive 1. Thin Mints 2. Do Si Do’s 3. Lemon Cremes 4. Sand Dollars 5. Chocolate Chip The first label should display the name of the cookie and precede the checkbox. The second label should say “Quantity” and precede the textbox. The textbox should only be long enough to show 2 digits.
Section IV
The fourth section entitled “Order Info”should contain a textarea element and a submit button. When the user clicks the button, your web page should calculate the total amount owed and display order information in the textarea. Requirements Your page should calculate the cost of the order based on the quantity and cookies that were selected. Each box of cookies is $3.50. If a user orders 10 boxes or more, there are no shipping costs. If they order less than 10 boxes, shipping costs is 5% of the total order costs
Explanation / Answer
<?php
?>
<!DOCTYPE html>
<html>
<head>
<title>GIRL SCOUT COOKIES</title>
</head>
<body>
<form action = "" method="GET">
<section>
<h1>Account Info</h1>
<pre>
First Name :<input type="text" name="f_nm">
Last Name :<input type="text" name="l_nm">
Street Address :<input type="text" name="add">
City :<input type="text" name="city">
State :<input type="text" name="state">
Zip-Code :<input type="text" name="z_cd">
<input type="radio" name="sel_add">Use Address for Shipping <input type="radio" name="sel_add">Use separate shipping address
</pre>
<?php
if(isset($_GET["send"]))
$rad = $_GET["sel_add"];
?>
</section>
<section>
<h1>Shipping Information</h1>
<pre>
Street Address :<input type="text" name="add" value = "<?php if(isset($_GET["send"]) && $rad == "Use Address for Shipping") echo "abcd" ?>">
City :<input type="text" name="city">
State :<input type="text" name="state">
Zip-Code :<input type="text" name="z_cd">
</pre>
</section>
<section>
<h1>Cookies</h1>
<pre>
Thin Mints<input type="checkbox" name="Cookies">
Do si Do's<input type="checkbox" name="Cookies">
Lemon Cremes<input type="checkbox" name="Cookies">
Sand Dollars<input type="checkbox" name="Cookies">
Chocolate Chip<input type="checkbox" name="Cookies">
Quantity :<input type="text" name="qty" size="2">
</pre>
</section>
<section>
<h1>Order Info</h1>
<pre>
Order Details:
<textarea rows = "10" cls = "20"></textarea>
<input type="submit" name="send" value = "Submit">
</pre>
</section>
</form>
</body>
</html>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.