All Browsers assign form data variable names according to the name
attribute, not id.

PHP uses square brackets as a shortcut to automagically build arrays
from the request data.  Like Karl said, this is illegal in HTML, and
still seems not allowed in XHTML according to
http://www.w3.org/TR/2008/PER-xml-20080205/#sec-common-syn (XHTML is
XML, remember).

That section has a paragraph beginning "The ASCII symbols and
punctuation marks, along with a fairly large group of Unicode symbol
characters, are excluded from names...", which leads me to believe
square brackets are still disallowed in XHTML names.  The allowed
unicode ranges given exclude the ascii range #x5B to #x7F (square
brackets are #x5B and #x5D).

Assuming I'm reading the spec correctly.  Most of the expanded
characters in XML seem to be in a much higher range than ascii.

Personally, I wish PHP didn't do this with square brackets.

On Feb 7, 2008 4:29 PM, Dave Stewart <[EMAIL PROTECTED]> wrote:
>
> OK - this is the best I could come up:
>
>         function $$(selector, context){
>                 return jQuery(selector.replace(/(\[|\])/g, '\\$1'),
> context)
>                 }
>
>         $$('#contact[email]')
>
> It adds to the global namespace (so won't work with prototype for
> example, which also uses $$) but it does do trick.
>
> Thoughts?
>

Reply via email to