Changes

Jump to: navigation, search

BTC640/ProcessingPrereq

1,076 bytes added, 18:57, 17 January 2012
no edit summary
* http://en.wikipedia.org/wiki/Html_tags
* http://www.quirksmode.org/dom/w3c_core.html
* http://json.org/
* http://www.json.org/js.html
* http://stackoverflow.com/questions/920930/how-to-create-json-by-javascript-for-loop
 
= Lab =
 
In the lab you're going to practice your JavaScript skills, JSON, and your understanding of the DOM. Implied in that is your understanding of HTML. We're not going to do any PHP or Java.
 
Create a webpage (on your local machine, no need to put it up on a server) where the user can input a variable number of people's contact info. By default only one set of fields (for one record) will show up. When the user clicks the "+" button an extra field is to be added at the bottom.
 
Make sure even rows have white background and odd rows have a gray background. Set the background using the appropriate .style attribute for the appropriate HTML/DOM element.
 
Write a JavaScript function that will be executed when the user clicks the submit button. That function should create a JSON object from all the fields (filled-in or not) on the page; then use JSON.stringify() to print your variable just below the form (do not use an alert).

Navigation menu