View Single Post
Old 08-31-2012, 02:07 PM   PM User | #1
russthebarber
New to the CF scene

 
Join Date: Dec 2011
Location: U.K.
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
russthebarber is an unknown quantity at this point
Send JSON array alongside HTML form

I have a basic form as follows:

Code:
<form action="myForm_submit.php" method="post" accept-charset="utf-8" name="myForm">
<input type = "text" name="firstName" />	
<input type = "text" name="lastName" />	

<input type="submit" value="Submit">
</form>
And I have a javascript array:

Code:
myArray = ["bananas", "apples", "pears", "peaches", "oranges"];
When I hit submit and send my form data I would like to send myArray in JSON format to my php submit file. How would I do that and how would I code the php $_POST = ..... for my JSON array?
russthebarber is offline   Reply With Quote