Handling arrays
-
Hello,
I have a series of checkboxes in a form all of which have values in the same array, called ‘wishlist’ so, for instance,
<input type="checkbox" name="wishlist[3]" value="3:foo" checked="checked" /> <input type="checkbox" name="wishlist[25]" value="25:bar" checked="checked" /> <input type="checkbox" name="wishlist[8382]" value="8382:baz" checked="checked" />
where the numbers are IDs of certain items and ‘foo’, ‘bar’ and ‘baz’ are titles. Furthermore, I have
[wishlist]
in the mail template.This works, inasmuch as the checked values are included in the email, but they’re not very easy to read because the come out all in one comma-separated line:
3:foo, 25:bar, 8232:baz
I’d really like each element on a separate line, of course: even better I’d like list elements, but I can live without that. I’ve tried adding newlines into the values of the checkboxes, in a number of different ways, as well as
<br />
tags, but the newlines are stripped and the tags end up in the email with entities so the user literally sees3:foo<br />, 25:bar<br />, 8232:baz<br />
Does anyone have any ideas?
Thank you,
Ben
- The topic ‘Handling arrays’ is closed to new replies.