[Catalyst] jQuery gotcha
S.A. Kiehn
keenlinks at ymail.com
Mon Feb 1 04:13:20 GMT 2010
Found a change in the latest jQuery (1.4.1) from the previous release I use=
d (1.3.2) that affected a Catalyst app of mine.=A0 Regarding form field su=
bmissions, jQuery now submits multiple checkbox (or select) values with the=
variable name followed by the array "[]" brackets (probably to appease PHP=
).=A0 I had a problem with a previous working app and used firebug to look =
at my JSON post and found the brackets.
What used to be:
=A0=A0=A0 tags=A0 25
=A0=A0=A0 tags=A0 18
=A0=A0=A0 tags=A0 10
is now:
=A0=A0=A0 tags[]=A0 25
=A0=A0=A0 tags[]=A0 18
=A0=A0=A0 tags[]=A0 10
Changing:
=A0=A0=A0 my $tags =3D $c->request->params->{tags};
to:
=A0=A0=A0 my $tags =3D $c->request->params->{'tags[]'};
corrected it (the quotes are needed).=A0 Hope this is helpful.
This was my first post, been reading forums for awhile and want to thank al=
l of you for the skill and knowledge you offer.=A0 I thank you for the foru=
m posts, blogs, calendars and books.=A0 I am not a trained programmer, but =
with your help I have been able to build a few production Catalyst apps.
Thanks,
Scott K.
=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100131/e4e3a=
379/attachment.htm
More information about the Catalyst
mailing list