8 Jan 2010 12:39 AM #131
Try naming your field data[repairorder][services]
Note the additional square brackets!
8 Jan 2010 10:18 AM #132
Thanks for the tip. Gotta love square brackets. In this case it didn't work for me. I added the trailing  to the hiddenName field and the existing value in the field did not display nor would the new values save.
When I manually edit the record using an SQL tool to put comma-delimited values in, the display shows the selections (yeah!) but saves only the last one in the list.
I will see if I can assemble the array on the PHP side. The POST is obviously sending the elements. Hmmm...
8 Jan 2010 1:27 PM #133
@frederickd, I'm travelling in Europe at the moment and am limited to my iPhone. I'll take another look in a few days when I'm back at home and will see if I can help further - please bear with me.
11 Jan 2010 7:36 AM #134
12 Jan 2010 5:44 PM #135
Thank you for taking a look at this. I hope you had a safe return.
12 Jan 2010 7:18 PM #136
I've just performed some testing and the values are submitted correctly, you therefore have a problem with your PHP code.
As I said, an array of values is posted to the server (hence the need for square brackets).
If you have setup the component correctly and you can see the array of data posted with firebug, you'll need to debug the issues on your server.
12 Jan 2010 7:36 PM #137
12 Jan 2010 7:51 PM #138
I was experimenting with the statement v = v.toString(); to remove the array. However, I do not know how to load the variable into the original field before sending it along for the POST.
Do you think that is a viable approach? Thanks!
12 Jan 2010 8:01 PM #139
Firstly, what does a screendump from the Firebug net panel look like showing the post data?
Secondly, what does a dump of the $_POST data look like when it arrives on the server?
12 Jan 2010 8:28 PM #140
Here is the POST from FireBug:
Here is the POST data from my server just after receipt and before doing the save to the database:
[POST data] => Array
[Repairorder] => Array
[distributor_id] => 1
[dealer_id] => 1
[advisor_id] => 1
[number] => RO20100107b
[servicedate] => 2010-01-07
[customer_email] => firstname.lastname@example.org
[vin] => 5TDZT34A05S250524
[year] => 2008
[make] => Toyota
[model] => 4-Runner
[odometer] => 13456
[odometer_type] => Miles
[lof] => Premium
[services] => Driveline
This is with the configuration option of hiddenName: 'data[Repairorder][services]'. Like this I have noticed that I can start entering characters in a little text box and the list of elements matching appear for selection, which is great. When I have the configuration option of hiddenName: 'data[Repairorder][services]' that feature no longer works, but the blank array entry from the FireBug POST data is gone.
I do not know why all the array elements would not be passed back to the server. I did notice that on the 2.x extensions forum for SuperBoxSelect someone else had a similar problem and solved it by having the JSON data show [Repairorder][services]. So maybe it is because the JSON data is coming down as a text field, but trying to go back as an array.
Maybe instead of a "workaround" a configuration option could be added like returnType with a default of 'array' but an option of 'text'.
Just a thought...