Ajax Forms and PHP

Ajax Forms and PHP

Hi guys.

I have created an ajax form script. That means, if you send a form, the page is not reloaded. The form data is sent through an ajax request. My javascript does this:

- traversing through the form and creating an array with the form data.
- sending an $.post request with the created array as data

On the other side an php script handles the data. And here is my problem. The script must work exacly how the browser sends its form data:

Content of php $_POST:

array(4) {
  ["name"]=> string(0) "My Name"
  ["email"]=> string(0) "my@email.com"
  ["message"]=> string(0) "Hello..."
  ["MultipleSelects"]=> array(2) {
    [0]=> string(10) "Select1"
    [1]=> string(10) "Select2"
  }
}


I build my javascript array exactly like this data. In case of the multiple selection box, an array with the selected elements as array element. But jquery.post does not accept arrays with arrays as element. How can I solve this? And how can I make shure that the php $_POST variables get exacly filled like above with ajax.

Thank you for your help

Yves