[Javascript] AJAX: how2post arrays

Michael Borchers list at tridemail.de
Thu Nov 16 08:46:34 CST 2006



> On Thu, Nov 16, 2006 at 03:37:42PM +0100, Michael Borchers wrote:
>> my POST AJAX script works fine for single <input> fields so far, but how 
>> do
>> i post arrays like:
>>
>> <input type="checkbox" name="foo[]">
>> <input type="checkbox" name="foo[]">
>
> Since they lack values, its rather difficult.
>
> If they had values, then mock up a form, hit submit, look at the
> generated URL. That will tell you how to x-url-form-encode the data.

good idea, example for these both tags selected:
<input type="checkbox" name="foo[]" value="1">
<input type="checkbox" name="foo[]" value="2">

URL:  foo%5B%5D=1&foo%5B%5D=2 




More information about the Javascript mailing list