1283 Posts
Bucklash
8 years ago
Topic

Hi folks

RE Email Field and values selected from a multiple select field

At the moment in the message field, from the multiple select I have:

option1,option2 // In the message area I add #my_multi_select_field#

I am aiming to have:

option1, option2 // space between values

I could either

a) do some funky BeforeStore stuff or

b) put a space after each option in multiple select (but that is not ideal) ...

c) do some jquery to manipulate values in multi select

Any alternative methods to suggest?

Thanks

Bucklash

Get a Book for SEBLOD
8 years ago
1
Level 1

Hi Bucklash,

I would advise to not change the value in database (PHP method like jQuery) because in edition the field select multiple will be bad.

By cons, you can add an "Afterstore" field, before your Email field.

In the code you can make a str_replace to replace "," by ", " in the text property of the select field

$fields['select_field_name']->text = str_replace( ",", ", ", $fields['select_field_name']->text );


Regards.

Lionel

1283 Posts
Bucklash
8 years ago
0
Level 2

Hi Lionel

By cons, you can add an "Afterstore" field, before your Email field.

Thanks for the idea and example

appreciated

Bucklash

Get a Book for SEBLOD