Posting each input
Posting each input
Hi, im trying to post each input element in my form.
The elements are generated with a click function.
So if there are 2 elements i want to post the values of both to a php script.
This is what ive tried so far but it doesnt appear to work.
- jQuery('#upload_form').submit(function()
{
var list = jQuery('input[id^="uploaded_file_name"]').length;
jQuery.post('process.php',
{
for(var i=0; i<list; i++)
{
files:jQuery('#uploaded_file_name_'+i).val()
}
} ,function(data)
{
if (data == 1)
{
alert(data)
}
else
{
alert(data)
}
});
return false;
});
i get a missing : after property id error on for(var i=0; i<list; i++)
Can anyone help? thanks