Send post request with JS problem

Send post request with JS problem

I have a multiple file upload form, that works fine, until I add a form validation and I call the upload.php from JS file with

$.post("upload.php", { name: nameVal, file: fileVal } ,

where

var fileVal = $("#file").val();

the upload.php doesn't get the multiple files anymore.
In the form I use:

<input type="file" class="multi" name="userfile[]" id="file" accept="jpg"/>

I don't know, how can I send through all these uploaded files from JS. I need an array? or how? please help me
or just provide a link to a tutorial.

thanks