Nov 17th, 2010, 2:45 PM
(Nov 12th, 2010, 11:15 AM)Ben Wrote: Hey bonkteam,
Yes, you can do it with select fields too. Just add the same "[]" chars to the name attribute like you did, then add two more attributes to your select:
Code:<select ... multiple size="4">
That will expand the dropdown to 4 rows high and allow the user to select multiple items.
Alex - Good question! I'll give this a very, very tentative "yes"......... This is something I built into the code back with the earliest 2.0.0 beta, but I've never truly tested it out (!). Just add this line to your config.php file:
PHP Code:$g_multi_val_delimiter = "\n";
This overrides the default ", " value for ALL fields. Here's what I wrote in the library.php file (where it's defined):
PHP Code:/**
* This determines the value used in the database to separate multiple field values (checkboxes and
* multi-select boxes) and image filenames (main image, main thumb, search results thumb). It's strongly
* recommended that unless you have a programmatical reason, you should leave it to the default comma-space
* value.
* @global string $g_multi_val_delimiter
*/
$g_multi_val_delimiter = ", ";
Warning: if you already have data in your form tables, this will mess it up. You'd need to manually update the records in the database to give it whatever different delimiter character(s) you choose.
- Ben
thanks ben,it seems to work for almost all the options but i still have one problem left.
if i have 2 text boxes for example:
<input class="form-textbox" type="text" id="finish1" name="finish[]" size="4" />
<input class="form-textbox" type="text" id="finish2" name="finish[]" size="4" />
if each text-box will get only 1 or 2 characters it puts them on the same field in the table without the \n between them.the solution you suggested does work perfectly for more then 2 characters.
here is an example:
any idea how to fix it? im trying to figure it out for hours but no luck :/ ..maybe trying to format the table diffrently in the export modules?