Day 6:

HTML Code for Wish list and Footer

section id = "note" contenteditable = "true">

(Enter the things you would like to purchase later)

</br

a href="#" onclick="reset_note();return false">Reset Note&$60;/A>

/section <!-- Ends wish list or note section-->

Footer id="the_footer">

Copyright 2014

/Footer>

/section>

br

ol

liThe first line sets up a section called note

liThe contenteditable attribute specifies whether the content of an element is editable or not.

<LI>The line of text telling the user the things they would like to purchase is the editable line.

<LI>Contenteditable is a new term in HTML5.

liThe onClick line will direct the browser to a javascript file allowing us to store items keyed in the note or wish list.

<LI>Next we end the section.

liThe footer is set up next

<LI>The footer is used for things like copyright dates or other data that is pertinent to the web page.

</ol

Cascading Style Sheet Code for Note and Footer

#note{

display:-webkit-box;

-webkit-box-orient:horizontal;

background:fuchsia;

border: 5px solid silver;

}

#the_footer{

text-align: center;

padding:20px;

background:gray;

border-Top:5px solid navy;

}

The note section is a webkit box. It is not flexible

It has a fuchsia background with a silver border

The footer is centered and has a top only border solid navy and a gray background.

Day 7:

Top header - logo and company name, Navigation bar

Load your html file into Notepad++.

Create a line under the opening header tag as follows.

imgsrc="midasLogo3.jpg" height=150 width=150

imgsrc="midasLogo3.jpg" height=150 width=150>

<h3Quality Jewelery at Affordable Prices/h3

br

br

br

br

No changes need to be made to the navigation bar, top menu or links in either file.

In your css file add the following line to your headline 2

br

h2{

font: bold 12px Tahoma;

color:white;

}

The default color for headlines is black. Our background is black, therefore our text will not show.

White is an excellent contrast.

After making the changes printout a copy of your css and html file listings as well as a print screen image pasted into a word processing program.

Turn these into your instructor.

Day 8:

Completing the products available for sale box - Article 1- kid 1

We need to download the pictures needed for this section.

There are eight pieces of jewelry we plan to sell on this shopping cart page

The images are numbered in order starting from zero and ending with 8

There are also images that have descriptions and are larger than the original ones.

We will see why that is important later

For now we need to download these images to your hard drive

Go to the section on Materials to Collect on this page and do the following.

Right click each image.

Save Image As.

Locate directory on your hard drive where your web page is being created.

Save as type JPEG.

Keep file names as indicated. For example, the pink ring is images0.jpg and the one with the description is images0b.jpg.

See table below for other file names.

File Names used on Products.html page

Item Name / First Image File / Second Image File
Pink Ring / images0.jpg / images0b.jpg
Jade Necklace / images1.jpg / images1b.jpg
Yellow Diamond Ring / Images2.jpg / Images2b.jpg
Citizens Watch / Images3.jpg / Images3b.jpg
Anniversary Band / Images4.jpg / Images4b.jpg
3 ct Diamond Ring / Images5.jpg / Images5b.jpg
2 ct Diamond Ring / Images6.jpg / Images6b.jpg
Emerald Cut Ring / Images7.jpg / Images7b.jpg
4 Ct cocktail ring / Images8.jpg / Images8b.jpg
10% Coupon / Coupon2.jpg

The heading for the products available section is complete

Section id="parent">

Article id="Kid1"Products For Sale

Put this information on your clipboard by dragging it putting it on the clipboard using CTRL + C and Inserting the following material between the Article 1 tags.

imgsrc="images0.jpg" id="0" title="Drag image to box on the right and drop." height=75 width=75 border= 3 draggable="true" ondragstart="drag(event)" onClick="openWin0()"/>

imgsrc="images1.jpg" id="1" title="Drag image to box on the right and drop." height=75 width=75 border= 3 draggable="true" ondragstart="drag(event)" onClick="openWin1()"/>

imgsrc="images2.jpg" id="2" title="Drag image to box on the right and drop." height=75 width=75 border= 3 draggable="true" ondragstart="drag(event)" onClick="openWin2()"/>

imgsrc="images3.jpg" id="3" title="Drag image to box on the right and drop." height=75 width=75 border= 3 draggable="true" ondragstart="drag(event)" onClick="openWin3()"/>

imgsrc="images4.jpg" id="4" title="Drag image to box on the right and drop." height=75 width=75 border= 3 draggable="true" ondragstart="drag(event)" onClick="openWin4()"/>

imgsrc="images5.jpg" id="5" title="Drag image to box on the right and drop." height=75 width=75 border= 3 draggable="true" ondragstart="drag(event)" onClick="openWin5()"/>

imgsrc="images6.jpg" id="6" title="Drag image to box on the right and drop." height=75 width=75 border= 3 draggable="true" ondragstart="drag(event)" onClick="openWin6()"/>

imgsrc="images7.jpg" id="7" title="Drag image to box on the right and drop." height=75 width=75 border= 3 draggable="true" ondragstart="drag(event)" onClick="openWin7()"/>

imgsrc="images8.jpg" id="8" title="Drag image to box on the right and drop." height=75 width=75 border= 3 draggable="true" ondragstart="drag(event)" onClick="openWin8()"/>

imgonMouseOver="bigImg(this)" onmouseout="normalImg(this)" border="3" src="coupon2.jpg" alt="Smiley" width="54" height="54" hspace="10">

In addition to the images on your page there are two JavaScript functions attached to each picture.

draggable="true" makes the picture able to be dragged to the shopping cart

There is also a JavaScript Function that is called once you begin to drag the object.

The next JavaScript function that is called, occurs when you click on each image.

The larger b image is opened in a separate window so that the user can see the picture in a larger format, see the description and the price.

There is a separate function for each image.

When you pass the cursor over the 10% coupon image, it enlarges and the user can see the special promotional code that can be used when placing their order.

When you move the cursor out of the coupon image, it returns to its normal size.

Now let's try it out, Launch in chrome your html shopping cart file.

We need to add a height of 190 pixels to kid 2 which is our shopping cart.

Make this change in your css file. Save it and try again. The box should look better.

I know that I am not happy with the color scheme for kid 1 - article 1.

In the css file change the background color for kid 1 from green to #ebc72a, which is a gold tone.

Save and run again.

Day 9:

HTML Shopping cart - Kid 2 and Kid 3 - Items Ordered.

We need to tell our html file where the drop zone is for the items

Find in your html page, the line that makes reference to article id="kid2"

Add the information about the ondrop and ondragover events to this line

Your line should look like the one below.

Do not forget the ending article tag.

article id="kid2" ondrop="drop(event)" ondragover="allowDrop(event)"centerShopping Cart/center/article

Save your file.

Later on in this tutorial we will add the code that actually makes this function work.

A special section is needed for items ordered.

Once the item are dropped into the shopping cart, we need to show the user which items were purchased and their costs.

The table consists of a check box and a text box showing that a particular item was purchased

In addition for each item, a check box and text box indicate the price of the item.

If the item has been dragged into the shopping cart its product name and price will show up in the table.

The check box indicates that the item has been ordered.

There is a table data cell for all 9 items available for purchase

Copy and paste the information from the scrollable box below to your html file just under <Article id:"kid3">.

Information for items ordered section of html page.

<Table cellpadding=3 cellspacing=3 border=0>

<TR>

<!-- item 0 -->

<TD<input type="checkbox" name="jewel" value="pink sapphire ring"> <input type="text" name = "item0" disabled > <br

<input type="checkbox" name="price" value="895.00"<input type="text" name="price0" disabled > </td>

<!-- item 1 -->

<TD<input type="checkbox" name="jewel" value="black pearl and jade necklace"<input type="text" name = "item1" disabled<br

<input type="checkbox" name="price" value="395.00"<input type="text" name="price1" disabled</td>

<!-- item 2 -->

<TD<input type="checkbox" name="jewel" value="yellow diamond ring 3ct."<input type="text" name="item2" disabled</br

<input type="checkbox" name="price" value="1895.00"<input type="text" name="price2" disabled</td>

</TR>

<TR>

<!-- item 3 -->

<TD<input type="checkbox" name="jewel" value="Citizens watch"<input type="text" name="item3" disabled </br

<input type="checkbox" name="price" value="695.00"<input type="text" name="price3" disabled </td>

<!-- item 4 -->

<TD<input type="checkbox" name="jewel" value="anniversary band"<input type="text" name="item4"disabled</br

<input type="checkbox" name="price" value="4910.00"<input type="text" name="price4"disabled</td>

<!-- item 5 -->

<TD<input type="checkbox" name="jewel" value="emerald cut 4ct diamond ring"<input type="text" name="item5"disabled</br

<input type="checkbox" name="price" value="1295.00"<input type="text" name="price5"disabled</td>

</TR>

<TR>

<!-- item 6 -->

<TD<input type="checkbox" name="jewel" value="cocktail 4ct diamond ring"<input type="text" name= "item6" disabled</br

<input type="checkbox" name="price" value="4295.00"<input type="text" name="price6" disabled</td>

<!-- item 7 -->

<TD<input type="checkbox" name="jewel" value="Blue Nile 5ct diamond ring"<input type="text" name="item7" disabled</br

<input type="checkbox" name="price" value="4000.00"<input type="text" name="price7" disabled</td>

<!-- item 8 -->

<TD<input type="checkbox" name="jewel" value="sapphire ring"<input type="text" name="item8" disabled</br

<input type="checkbox" name="price" value="3500.00"<input type="text" name="price8" disabled</td>

</TR>

</table>

</br

</article> <!-- end article 3-->

Day 10:

Completing the totals and Customer Information sections of the HTML file

We now need to work on kid 4 - Total Section and kid 5 - Customer Information

It is important that totals are updated each time an item is added to the shopping cart.

We need to keep track of subtotals, sales tax and shipping. There is also a place to enter the promotional code to receive a 10% discount

Take a look at the information below.

Totals Section

<table cellpadding=3 cellspacing=3 border=3>

Tr

<TD>Discount Code</td<td<input type="checkbox" name="discount"<input type="text" id="discountId" onchange = "calculateDiscount(productsForm);"</td>

<TD>Subtotal</td<td<input type=text name="subTotal" size=12 disabled</td>

</tr

<TD>Sales Tax</td<td<Input type =text name=salesTax size =12 disabled</td>

<TD>Shipping</td<td<input type=text name=shipping size = 12 disabled</td>

</tr

tr

td>Total</td<td<input type=text name="total" size=12 disabled</td>

</tr

</table>

br

Put this information on your clipboard and paste it between the beginning and ending tags for article 4

Save your html file

Customer Information Section

The next section that needs to be copied and pasted is the one that collects information about our customer who is placing the order.

Fieldset

legend>Personal Information</legend>

<Table cellpadding=3 cellspacing=3 border=3>

tr

td<Label for="firstname">First name</td<td<input id="first_name" type="text" name="firstname" placeholder="Enter your first name" required autofocus</Label</td>

</tr

<TD<Label for ="lastname"> Last name</td<td<input id="last_name" type="text" name="lastname"placeholder="Enter your last name" required</label</td>

</tr

td<label for="email">Email</td<td<input id="email" type="email" name="customeremail" placeholder="Required Field" required</label</td>

</tr

td<label for="address">Address</td<td<input id="addresss" type="text" name="customeraddress" placeholder="Required Field" required</label</td>

</tr

td<label for="city">City</td<td<input id="city" type="text" name="customercity" placeholder="Required Field" required</label</td>

</tr

td<label for="state">State</td<td<input id="state" type="text" name="customerstate" placeholder="Required Field" required</label</td>

</tr

td<label for="zip">Zip</td<td<input id="zip" type="text" name="customerzip" placeholder="Required Field" required</label</td>

</tr

</table>

<BR>

<BR>

<input type="Button" value="Submit Order"onClick="tallyorder(productsForm)";>

</fieldset

Paste the information right after this tag

article id="kid5"Customer Information

Thefieldset tag is used to group similar form elements and controls

This information will be sent to the email addresses specified in the mailto form tag as well as the items ordered and their prices when the submit button is pressed.

HTML5 has enhanced this form processing process by using labels, place holders and required field tags.

The information is arranged in a table.