[Xapian-discuss] For more UI functionality: OmegaScript, C++or other?
James Aylett
james-xapian at tartarus.org
Tue Apr 26 12:41:56 BST 2011
On 26 Apr 2011, at 11:56, Richard Boulton wrote:
>> So technically it seems you're right, but i havent seen a browser where
>>
>> <input type="checkbox" name="B[]" value="Edoc" /> doc
>>
>> does not send an array (recommendations welcome ;) )
>
> Sure, but I also haven't seen or heard of a browser where
>
> <input type="checkbox" name="B" value="Edoc" /> doc
>
> does not send all the values to the server. I believe some form
> processing systems on the backend will only present you with the first
> value in this situation (PHP seems a likely candidate to me, but I
> could be wrong there), but that's the server-side behaviour, not the
> browser behaviour.
PHP does magic if you name the input B[], I think, so that it makes all values available via B as an array. Another approach (eg that taken by Django) is to provide a "multi-map", so that you can get all the values out whatever the input name.
Strictly, the browser doesn't send an array ever; it just sends a number of name-value pairs, and each name can appear multiple times. How the backend system copes with this varies, as Richard points out. This stuff is pretty obscure unless you've done it in detail before though :)
J
--
James Aylett
talktorex.co.uk - xapian.org - devfort.com
More information about the Xapian-discuss
mailing list