[whatwg] additional key attribute in form field

On Fri, 06 Jul 2007 13:32:17 +0200, Alexander <nav at ciklum.net> wrote:

> i wonder why there's still no a special 'key' attribute for every form  
> field implemented.
>
> Let's say I have rendered table from query result and one column could  
> be updateable via text field.
> And let's say record id field is uniqueidentifier (not integer). I'd  
> like to write the following:
>
> <form ...>
> !--- Loop query results ---!
> <input type="text" key="{id_value_here}" name="quantity" value="">
> ....
> <input type="text" key="{id_value_here}" name="quantity" value="">
> !--- End of loop ---!
> </form>
>
> and
>
> when submitting the form and checking results on server, I'd like to  
> know the 'owner' of every quantity field:
>
> !--- loop via quantity fields ---!
> if (quantity.key == 'XXXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX') { ... }
> !--- end of loop ---!

The simple name/value pairs that form submission is organized in are  
sufficient for expressing data structures of any complexity.  
Multidimensional keys like (name, key) in your example can be expressed  
through combined names:

<input type="text" name="quantity:{id_value_here}" value="">


-- 
Alexey Feldgendler <alexey at feldgendler.ru>
[ICQ: 115226275] http://feldgendler.livejournal.com

Received on Friday, 6 July 2007 04:45:40 UTC