12.07.2015 Views

Pro JavaScript for Web Apps pdf - EBook Free Download

Pro JavaScript for Web Apps pdf - EBook Free Download

Pro JavaScript for Web Apps pdf - EBook Free Download

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 3 ADDING A VIEW MODELFigure 3-6. The empty basketSecond, the user has no way to clear the basket with a single action, so I will add a button that willreset the quantities of all of the products to zero. Finally, by moving the submit button outside the <strong>for</strong>melement, I have lost the ability to rely on the default action. I must add an event handler so that the usercan submit the <strong>for</strong>m. Listing 3-10 shows the HTML elements that I have added to support these features.Listing 3-10. Adding Elements to Finish the Example...Gourmet European CheeseBasketNo products selectedCheeseSubtotalTotal:$72www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!