Countries as multiple selection

Hi - can someone help me change country input in BxDolEvents.php (Add an Event for members frontend) to multiple selection?

Explanation: I'm using the country prevalues for musical genres, and want people to be able to select multiple genres for an event, for instance a festival.

It was easy to change select box to multiple selection, but values are not inserted into table even though I tried to change sdatingEvents tabel datatype to 'Set' and inserted the list of "country" codes into the lenght/values field.

I think that the step I'm missing is the insert command in BxDolEvents.php.

I've found this code around line 1835, but don't know how to alter:

$sCountriesOptions = '';

foreach ( $aPreValues['Country'] as $key => $value ) {
$sSC = ($sSelectedCountry == $key) ? 'selected="selected"' : '';
$sVal = _t($value['LKey']);
$sCountriesOptions .= "<option value=\"{$key}\" {$sSC}>{$sVal}</option>";
}

Can someone with php-knowledge help me???

Thanks in advance,

Dorit

Quote · 26 Feb 2009

go back to chng field to mult.

add:

multiple=\"multiple\"

to:

$sCountriesOptions .= "<option value=\"{$key}\" {$sSC}>{$sVal}</option>";

and comment:

//$sSC = ($sSelectedCountry == $key) ? 'selected="selected"' : '';

I havent tested....which I usually do but I know you want to try something NOW !! lol

I have video tutorials to help you mrpowless.com
Quote · 26 Feb 2009

Hi Darren. Thanks alot for ideas. Didn't help, though.

Instead of commenting out (gave me error) I've tried deleting:

//$sSC = ($sSelectedCountry == $key) ? 'selected="selected"' : '';

And inserted multiple=\"multiple\" like this:

$sCountriesOptions .= "<option value=\"{$key}\" multiple=\"multiple\" {$sSC}>{$sVal}</option> ";

However, still only one Country prevalue is saved to database and thus displayed on Event post...

Any other ideas?

Cheers,

Dorit

Quote · 28 Feb 2009

must have to completely take out the {$sSC}

If you see how its put together you can take it apart slowly....the form must be a multiple so we put that in....now just take out the selected value...and maybe check the events table to make sure it can hold them

Also see:

<tr class="vc">
<td class="form_label">{$sCountryC}:</td>
<td class="form_value">
<select class="form_select" multiple="multiple"name="event_country" id="event_country_id"">
{$sCountriesOptions}
</select>
<!-- <img id="flagImageId" src="{$sSitySrc}.gif" alt="flag" /> -->
</td>
</tr>

ALTER TABLE `SDatingEvents` CHANGE `Country` `Country` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'US'

theres add and edit, we now have the ability to add them multiple and the space in the DB just have to display them.

You have a lot more to do but I hope I am helping you understand how its built.

I have video tutorials to help you mrpowless.com
Quote · 28 Feb 2009

Thanks Darrren, but still no luck... Did you mean that I need to do still much more than you've explained?

I've tried to follow you directions, but (besides having a bit of a hangover...) I'm not much of a programmer.

I've deleted {$sSC} from $sCountriesOptions string, so I now have just:

$sCountriesOptions .= "<option value=\"{$key}\" multiple=\"multiple\">{$sVal}</option> ";

And I've tried both select class 'form_select' and 'input_select_multiple':

<select class="form_select" multiple="multiple" name="event_country" id="event_country_id">
{$sCountriesOptions}
</select>

And I've tried changing database table back to Varchar (20). Neither this change nor my own change to SET solved the issue...

Hmmm - anything else you can think of? Or do I just need to be more sober to get your directions right... Foot in mouth

Well, this seems a bit more complicated than I thought. I'm also realising that once I get the data input into database, I also need new script to display all preValues on Event page...


Cheers,

Dorit

Quote · 1 Mar 2009
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.