Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

how to assign associate array to field input



8:59 pm on Oct 22, 2010 (gmt 0)

5+ Year Member

<input type="checkbox" name="color[]" value="" />

I know this will get a regular array but how to do associative?

? <input type="checkbox" name="color['color_id']" value="" />


11:27 am on Oct 23, 2010 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

as far as i know that won't do anything for you in HTML.
you might try either hacking a form element name attribute value that can be processed in the script (... name="color:color_id" ...) or defining the associativity with some hidden input parameters.

http://www.w3.org/TR/REC-html40/types.html#type-cdata [w3.org]:
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

Featured Threads

Hot Threads This Week

Hot Threads This Month