187 Posts
Pathos
10 years ago
5
Topic
Hi,

is there a possibility that if i change a simple select field's option, that also all the fields already in the database change to that new 'name'. Or is this posible with other fields?

Has anyone encountered something like this?

Thanks
Get a Book for SEBLOD
693 Posts
rpoy
9 years ago
1
Level 1
Hi Pathos,

This depends on how you set up your options. If you have:
name1 = 1
name2 = 2
name3 = 3
etc...

And you want to change:
name1 = 1
Change to:
name4 = 1

then it will work.

But if you change the value, then they must all be changed.

Hope that helps,

Randy
187 Posts
Pathos
9 years ago
0
Level 2
Hi Randy,

thanks for answering, but could you elaborate?

I create a field with simple select. Then i can add options. I thought i should add the values for the options like so:

business a
business b
business c

etc.

Are you saying i can fill out the options like:

business a = 1
business b = 2

etc.


Greetings,
Joris
4229 Posts
Kadministrator
9 years ago
0
Level 1
Hi,

when form is submited, what is stored is option values, those depend on how you setup dropdown, if you did
business a = 1
business b = 2

then you can change label (first part, e.g. business a) to something else and all existing record will show this new label as only values (1,2 etc) are stored in db records.

But, if you have setup your dropdown with
business a
business b

Then "business a" is used for both - value and label and if you change this all existing record that have this value will be broken, you would need to chage them manually in the database.
693 Posts
rpoy
9 years ago
0
Level 1
Hi!

Just one other thing that I forgot to mention...

Assigning a value to your "business xx" - may have an effect on your desired outcome of your search order if this field is used in a search.  I have used this to force an order I wanted:

business c = a
business a = b
business b = c
etc..

Assigning a value can also be used in calculations as well.

Hope that helps,

Randy


107 Posts
terveg
9 years ago
0
Level 1
I'm trying now to lern how to use attributes for simple select. In your case i would suggest to add an custom attribute to each of your options. You ca easily "copy" the attribute of selected option to an hidden field. So if you have value=1 your custom attribute (let's call it "business")=a for example.
This might be usefull if you want to use as value(number) as an other data(like some extra text joined to your option)
Get a VIP membership