Created
November 10, 2012 23:52
-
-
Save sauntimo/4053026 to your computer and use it in GitHub Desktop.
Create NewSubmission Object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ----- CREATE NEWSUBMISSION OBJECT ----- */ | |
var NewSubmission = {}; | |
var Properties = ["Section One: Product Details","Size","Style","Filling","Topping","Decoration", | |
"Section Two: Delivery Details","First name","Family name","Email Address","Address","Delivery","Day","Month","Year"]; | |
var i = 0; | |
var iSkip = 0; | |
for(i = 0; i < Properties.length; i++){ | |
if(Properties[i].slice(0,7) == "Section"){ | |
NewSubmission[Properties[i]] = " "; | |
iSkip++; | |
} else { | |
//add 1 because Timestamp is e.values[0] and we don't need this | |
NewSubmission[Properties[i]] = e.values[(i+1)-iSkip]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment