5 years ago
Topic

Hi,

I have created a form that contains a multie select field (Field A) with 20 options. To make it easy to select multiple I display ten of them in view. Works great.

Now I'm working on my search form and want to be able to search for the options in this field. However in the search form I do not want the entire block of ten in view to be visible. I just want a simple dropdown select where the user can only select one option.

I have not been able to find a solution for this. Would it be possible to create a second field (field B) that will show the options from Field A, so I can use this as a simple dropdown in my search form?

As an alternative I have tried to use fieldX for Field A, It stores the content, but when I try to use this in my search form I end up with no search results.

Any suggestions, workarounds or better ways to do this?

Thanks in advance,

Joep

Get a Book for SEBLOD
5 years ago
7
Level 1

Hi,

I found some additional info about fieldX (https://github.com/Octopoos/SEBLOD/issues/34 and https://www.seblod.com/community/forums/forms-content-types/storage-confusion) and decided to go with the fieldX.

In the admin form everything works fine. In the search form I clicked + in [3] and selected the fieldX as the "Collection". Now when i search on this field the search results contain all articles instead of only those that match the option searched for.

Do you have any thoughts on this?

Thanks!

Joep

1283 Posts
Bucklash
5 years ago
6
Level 2

Re selects

I often have fields in my search forms as variation of content forms

so what settings are applied on field ie storage. does it look good in the db?

5 years ago
5
Level 3

Thank you for your reply.

The storage of the field is set tot NONE and the storage of the fieldX is set to SEBLOD::syntax:: | Article | shops[branche]

The options are stored in the database in table #_cck_store_item_content in the column shops. Through the admin form I can add and select the options. After saving and reloading the form the selected options remain present.


It is just the search form that keeps giving me all results instead of only those that match the search.

1283 Posts
Bucklash
5 years ago
4
Level 4

Hi

I reckon your search form fieldd storage should be the field it is searching....disclaimer: i am no fieldx guru, it’s not my kinda thing :D

5 years ago
3
Level 5

Hi Bucklash,

Yes, the field it is searching is in the searchform. It also points to the fieldX.

If you know an alternative that offers multi select in the admin form and single select (simple drop dopdown) in the search form I would be happy to know about it.

1283 Posts
Bucklash
5 years ago
2
Level 6

I am not actually sure what you are trying to do...

re multi select... 

I use quite a lot SELCET DYNAMIC, and have that set to multi, I also apply chosen.js to it.

In my db, I store values i.e. "123,234,345,456"

In search I apply 3 Match as any words exact, multiple to allow user to search with more than one value... stuff like that.

Field x is really for when you want to create new values in db as opposed to referencing data that already exists (because if data exists in db already can just use multi select)...

Re fieldx, you said it's storage was none.... o that is why I suggested reversing that

5 years ago
1
Level 7

You probably misread my info about the storage. Only the single select was set to storage none. The fieldX was set to custom storage.

I don't know what it is with fieldX in search forms. The threads I find about this don't offer a real solution. For some people it seems to work, but for most people not.

Let's get back to the multi select field. I created on and showed 10 items in view in order to make it easy to select multiple. When you add this multi select field to the search form it has the same height of 10 items in view. I do not want that in de search form. Instead I would like to have a simple dropdown where the user can select only one option. SInce I couldn't find how to to that I ended up using fieldX.

I'm a Seblod newbie and highly appreciate your help on this.

5 years ago
0
Level 8

Hi Bucklash,

I finally got it working after reading this: https://www.seblod.com/community/forums/general-discussions/search-groupx-data-in-users


TLDR;

The fieldX content is stored like this:

Custom | Article | column_name[field_name]


The simple select field that is use by the fieldX is stored in this way:

Custom | User | column_name


So, setting the storage of the simple select list to NONE is incorrect.

Thanks you for your help!

Get a VIP membership