8 years ago
9
Topic

Hello, 

I'm trying to increment a dynamic list from a text field in the same form. Here's how I want it to work : 

The user looks if his option is available in the dynamic list field, if not there's a text field where he can write his option. When he presses the submit button, what he wrote in the text field automatically increments the dynamic field so that it is saved for future submissions. 

I'm just trying to figure out how to save the text in the SQL table-field where the dynamic list takes his option out of. I tried many possibilities but none worked.. 

If you have any solution or advice I would greatly appreciate it ! 

Thanks !

Get a Book for SEBLOD
1283 Posts
Bucklash
8 years ago
4
Level 1

Hi

Ultimately, you are creating tags aren't you?

Maybe use select2 plugin to try adding values that way... the trouble is then deleting them. What kind if control fo you want.

I did this a few days ago - lurking in the quantum like world of fieldx - where I creared a category called my-list.

I creared an article content type with the catid as 'my-list' (using live value).

In my form:

I created a select dynamic field (dynamic_field) which pulled in the title and id of the 'my-list' articles. Storage set to none!!!!

In my form:

I then added a fieldx field (dynamic_fieldx) which repeats the select dynamic field:

storage: custom|article|dynamic_fieldx[dynamic_field]


I then have a button free which links to a form where I can add another article to the 'my-list' category.

This then appears as an option to sepect with fieldx


I'm at work, on my iphone, so that is the best I can explain it....


Bucklash

8 years ago
3
Level 2

Hi ! 
Thanks for answering quickly ! 

I'm trying your solution right now but i'm pretty new at seblod and there's not a lot of documentation on how to configure the dynamic list. I have to reach the catid of 'my-list' in the table option ? 

1283 Posts
Bucklash
8 years ago
2
Level 3

Hi

Select dynamic field:

Name: list_field // or whatever

table: #__content

title: title

value: id

where: catid=12 // or whatever it is

STORAGE: NONE

Create a fieldx field:

list_field_fx

field to fieldx: list_field // or whatever it is

storage: custom|article|list_field_fx[list_field]

Bucklash

8 years ago
1
Level 4

Thanks a lot !! 
But what i don't seem to get is the purpose of the fieldX field since it looks like it's working fine without it 

4229 Posts
Kadministrator
8 years ago
0
Level 5

field x would enable you to add multiple new entries

4229 Posts
Kadministrator
8 years ago
2
Level 1

Currently only built-in way to do that without saving would be to use tags field.

If you are ok with saving you could make text field to save to some column of your content type table (see manual) , then use select dynamic to pull all values from that table/column

8 years ago
1
Level 2

Thanks ! 
So i just tried it, it works but does it have to be on seperate forms ?

4229 Posts
Kadministrator
8 years ago
0
Level 3

It does not need to be on separate forms, just user will need to save form (with redirection set to Form-edition  so that he gets back to the same form), before he can use it in dropdown.

8 years ago
0
Level 1

Thanks a lot, I managed to use your very useful help ! Everything works fine now ! 

Get a VIP membership