HTML/JavaScript shopping cart help

Reply

Join Date: Nov 2009
Posts: 12
Reputation: Rblalock is an unknown quantity at this point 
Solved Threads: 0
Rblalock Rblalock is offline Offline
Newbie Poster

HTML/JavaScript shopping cart help

 
0
  #1
Nov 8th, 2009
Hello, I'm new to the DaniWeb community and I am in need of some serious help. I am taking a web design class, but the teacher I currently have now has no idea what he is doing; he is an Info Tech teacher, but we have two classes at the same time.

I have to create a shopping cart for my class, and I you can tell, I have no idea how to create a shopping cart with HTML and JavaScript.

I do not have any money to give for anyone's help, but if anyone thinks they might be able to help me create it, I will send them the coding I have at this moment.
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 12
Reputation: Rblalock is an unknown quantity at this point 
Solved Threads: 0
Rblalock Rblalock is offline Offline
Newbie Poster
 
0
  #2
Nov 8th, 2009
Here is the coding...

  1. <html>
  2. <head>
  3. <title>Moultrie Technical College - Worth County Campus</title>
  4.  
  5. <style type="text/css" media="all">
  6.  
  7. /* Ryan Blalock (ShoppingCart.htm)
  8. 9/29/09 */
  9.  
  10. body {
  11. background: transparent url(images/bg.gif) repeat left top; }
  12.  
  13. table {
  14. color:white;
  15. width: 800px;
  16. margin-left: auto;
  17. margin-right: auto;
  18. font-size: 10pt;
  19. font-family: arial,helvetica,sans-serif;
  20. background-color: black; }
  21.  
  22. td#header {
  23. font-size: 16pt;
  24. text-align: center; }
  25.  
  26. td, th {
  27. padding: .3em; }
  28.  
  29. td.align {
  30. vertical-align: top; }
  31.  
  32. h1 {
  33. width: 775px;
  34. height: 125px;
  35. font-size: 20pt;
  36. font-family: "bernhardmod BT",serif;
  37. padding: 15 15 0 40;
  38. background-image: url(logo.png);
  39. background-repeat: no-repeat;
  40. text-align: center;
  41. border-bottom: groove thick;
  42. margin-bottom: 0; }
  43.  
  44. .center {
  45. text-align: center; }
  46.  
  47. tr#black {
  48. color: white;
  49. background-color: black;
  50. font-weight: bold;
  51. text-align: center; }
  52.  
  53. tr#nav {
  54. color: black;
  55. background: #000 url(images/headergradient.png) repeat-x left bottom;
  56. font-weight: bold;
  57. text-align: center; }
  58.  
  59. tr#header {
  60. color: black;
  61. background-color: #FFF;
  62. font-weight: bold;
  63. text-align: center; }
  64.  
  65. td#body {
  66. color: black;
  67. background-color: #FFF;
  68. text-align: justify; }
  69.  
  70. button {
  71. margin-left: 1em; }
  72.  
  73. </style>
  74.  
  75. <script type="text/javascript">
  76.  
  77. var imageclock=new Object()
  78. //Enter path to clock digit images here, in order of 0-9, then "am/pm", then colon image:
  79. imageclock.digits=["images/clock/c0.gif", "images/clock/c1.gif", "images/clock/c2.gif", "images/clock/c3.gif", "images/clock/c4.gif", "images/clock/c5.gif", "images/clock/c6.gif", "images/clock/c7.gif", "images/clock/c8.gif", "images/clock/c9.gif", "images/clock/cam.gif", "images/clock/cpm.gif", "images/clock/colon.gif"]
  80. imageclock.instances=0
  81. var preloadimages=[]
  82. for (var i=0; i<imageclock.digits.length; i++){ //preload images
  83. preloadimages[i]=new Image()
  84. preloadimages[i].src=imageclock.digits[i]
  85. }
  86.  
  87. imageclock.imageHTML=function(timestring){ //return timestring (ie: 1:56:38) into string of images instead
  88. var sections=timestring.split(":")
  89. if (sections[0]=="0") //If hour field is 0 (aka 12 AM)
  90. sections[0]="12"
  91. else if (sections[0]>=13)
  92. sections[0]=sections[0]-12+""
  93. for (var i=0; i<sections.length; i++){
  94. if (sections[i].length==1)
  95. sections[i]='<img src="'+imageclock.digits[0]+'" /> '+'<img src="'+imageclock.digits[parseInt(sections[i])]+'" /> '
  96. else
  97. sections[i]='<img src="'+imageclock.digits[parseInt(sections[i].charAt(0))]+'" /> '+'<img src="'+imageclock.digits[parseInt(sections[i].charAt(1))]+'" /> '
  98. }
  99. return sections[0]+'<img src="'+imageclock.digits[12]+'" /> '+sections[1]+'<img src="'+imageclock.digits[12]+'" /> '+sections[2]
  100. }
  101.  
  102. imageclock.display=function(){
  103. var clockinstance=this
  104. this.spanid="clockspan"+(imageclock.instances++)
  105. document.write('<span id="'+this.spanid+'"> </span> ')
  106. this.update()
  107. setInterval(function(){clockinstance.update()}, 1000)
  108. }
  109.  
  110. imageclock.display.prototype.update=function(){
  111. var dateobj=new Date()
  112. var currenttime=dateobj.getHours()+":"+dateobj.getMinutes()+":"+dateobj.getSeconds() //create time string
  113. var currenttimeHTML=imageclock.imageHTML(currenttime)+'<img src="'+((dateobj.getHours()>=12)? imageclock.digits[11] : imageclock.digits[10])+'" />'
  114. document.getElementById(this.spanid).innerHTML=currenttimeHTML
  115.  
  116. }
  117.  
  118. function checkForm1() {
  119. if (document.form1.prod.selectedIndex == 0)
  120. {alert ("Select literature");
  121. return false;}
  122. else if (document.form1.qty.selectedIndex == 0)
  123. {alert ("Select quantity");
  124. return false;}
  125. else if (document.form1.ship.value == "0.00")
  126. {alert ("Select a shipping option");
  127. return false;}
  128. else return true;
  129. }
  130.  
  131. </script>
  132. </head>
  133.  
  134. <body>
  135. <div class="center">
  136.  
  137. <table border="0">
  138. <tr id="header">
  139. <td colspan="2"><h1>Moultrie Technical College<br />Worth County Campus</td>
  140. </tr>
  141. <tr>
  142. <td align="right">
  143. <script type="text/javascript">
  144.  
  145. new imageclock.display()
  146.  
  147. </script>
  148. </td></tr>
  149. <tr id="nav">
  150.  
  151. <td>Navigation:: <a href="index.html">Home</a> | <a href="infotech.html">Information Technology</a> | <a href="webdesign.html">Web Design</a> | <a href="cosmo.html">Cosmetology</a> | <a href="cal.html">Calendar</a> | <a href="comptia.html">CompTIA</a></td>
  152.  
  153. </tr>
  154. <tr>
  155.  
  156. <td id="body">E-mail us at:
  157. <b><script type="text/javascript">
  158. document.write("moultrie@moultrietech.edu");
  159. </script></b></td></tr>
  160.  
  161. <tr>
  162. <td id="body" colspan="2"><br /><p>Welcome to the Moultrie Tech - Worth County- campus bookstore. Located on this page, you will find all the literature needed for the Moultrie Tech classes given at the Moultrie Tech - Worth Campus. If, for some reason, the literature that you need is not available on this page, please try the other Moultrie Tech campuses' bookstores. Literature needed for each quarter of classes will vary by teacher, and if any questions are to come to mind, feel free to ask.</p>
  163.  
  164. <p><strong><u>Web Design Literature</u></strong></p>
  165.  
  166. <p><img src="HTML.jpg" alt="Quarter One: HTML Literature" width="75" height="75" /><input type="checkbox" id="HTML" value="HTML" />New Perspectives: Blended HTML, XHTML, and CSS Introductory <strong>$73.49</strong></p>
  167. <select id="quantity" size="1">
  168. <option>Quantity</option>
  169. <option>1</option>
  170. <option>2</option>
  171. <option>3</option>
  172. <option>4</option>
  173. <option>5</option>
  174. <option>6</option>
  175. <option>7</option>
  176. <option>8</option>
  177. <option>9</option>
  178. <option>10</option>
  179. </select>
  180. <button type="submit">Add to Cart</button>
  181.  
  182. <p><img src="javascript.jpg" alt="Quarter Two: JavaScript Literature" width="75" height="75" /><input type="checkbox" id="javascript" value="javascript" />New Perspectives: JavaScript <strong>$63.49</strong></p>
  183. <select id="quantity" size="1">
  184. <option>Quantity</option>
  185. <option>1</option>
  186. <option>2</option>
  187. <option>3</option>
  188. <option>4</option>
  189. <option>5</option>
  190. <option>6</option>
  191. <option>7</option>
  192. <option>8</option>
  193. <option>9</option>
  194. <option>10</option>
  195. </select>
  196. <button type="submit">Add to Cart</button>
  197.  
  198. <p><img src="dreamweaver.jpg" alt="Quarter Three: Dreamweaver literature" width="75" height="75" /><input type="checkbox" id="dreamweaver" value="dreamweaver" />New Perspectives on Adobe Dreamweaver CS4 <strong>$84.49</strong></p>
  199. <select id="quantity" size="1">
  200. <option>Quantity</option>
  201. <option>1</option>
  202. <option>2</option>
  203. <option>3</option>
  204. <option>4</option>
  205. <option>5</option>
  206. <option>6</option>
  207. <option>7</option>
  208. <option>8</option>
  209. <option>9</option>
  210. <option>10</option>
  211. </select>
  212. <button type="submit">Add to Cart</button>
  213.  
  214. <p><img src="photoshop.jpg" alt="Quarter Four: Photoshop literature" width="75" height="75" /><input type="checkbox" id="photoshop" value="photoshop" />Adobe Photoshop CS4: Complete Concepts and Techniques <strong>$66.49</strong></p>
  215. <select id="quantity" size="1">
  216. <option>Quantity</option>
  217. <option>1</option>
  218. <option>2</option>
  219. <option>3</option>
  220. <option>4</option>
  221. <option>5</option>
  222. <option>6</option>
  223. <option>7</option>
  224. <option>8</option>
  225. <option>9</option>
  226. <option>10</option>
  227. </select>
  228. <button type="submit">Add to Cart</button>
  229.  
  230. <br />
  231. <br />
  232.  
  233. <p><strong><u>Info Tech Literature</u></strong></p>
  234.  
  235.  
  236.  
  237. <p><strong><u>Cosmetology</u></strong></p>
  238.  
  239.  
  240.  
  241.  
  242. <tr id="black">
  243. <td colspan="2">1210 North Monroe Street Sylvester, GA 31791.</td>
  244. </tr>
  245. </table>
  246. </div>
  247. </body>
  248. </html>
Last edited by peter_budo; Nov 13th, 2009 at 5:31 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
Reply With Quote Quick reply to this message  
Reply

Tags
cart, html, javascript, shopping

Message:



Similar Threads
Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



Tag cloud for cart, html, javascript, shopping
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC