Forum


19:37

20/03/2009

Hi, I have a grid with an add button that loads the form editting form.
On the form is a select box with the multiple option set to true(the description field). The idea is I would like a list of the values posted to the server when the form is submitted.
Here's the problem(which probably has an easy solution that is glaring at me ...)
When the form is submitted the description values are all submitted but as(according to firephp):
DESCRIPTION 3
DESCRIPTION 5
DESCRIPTION 8
DESCRIPTION 6
On the server side :
$desc = $_POST['DESCRIPTION'];
yields only the value 6 ...
I've saw posts in regards to using explode but that would work if I was pulling a comma-delim string from the db to send to the table. Here I want to receive the values, assemble as a comma-delim string and then submit to the db.
Any suggestions ?
Nathan
00:43

16/12/2008

According to Tony's response to me in this post, the results should already be returned in the form of a comma separated string (hence the use of explode to convert to an array).
To convert from an array to string, you'd use implode - but this doesn't really make sense as the data should be in the form of a string in the first place.
If you want to start by posting an array, see the hack that I made, then use implode to convert it to a string: implode(",",$your_array);
http://www.trirand.com/blog/?p.....8;search=1
Adam
Most Users Ever Online: 715
Currently Online:
69 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66