Forums

multiple element --> mysql

herates 28 Feb, 2008
hi,

i've this elemnt in my form:

<select multiple="multiple" size="5"
name="xxx">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option></option>
</select>

but chronoforms just save the last selected item into the database.

i tried xxx[] as name for the element. but it doesn't work either.

is there someone outside, who has an idea for my problem?

wolfgang
GreyHead 28 Feb, 2008
Hi wolfgang,

You definitely need name="xxx[]" to store multiple values. I didn't think you need to do anything else. Happy to check though, please take a Form Backup in the Forms Manager and post it here or email it to me at the address in my sig.

Bob<br><br>Post edited by: GreyHead, at: 2008/02/28 14:20
herates 28 Feb, 2008
i don't know why, now it works well with xxx[].

it was too late yesterday.

But how do i save the array-elements into mysql? at the moment it just save an string (Array).


wolfgang
GreyHead 28 Feb, 2008
Hi wolfgang,

I though that this had been fixed😟

Go to the Autogenerated tab, take a backup copy of the code in then tab for safety. Then edit the AutoGenerated code to replace $_POST['xxx'] with implode(', ', $_POST['xxx']) - this should convert the array to a comma seperated list.

Bob
This topic is locked and no more replies can be posted.