Jump to content

select field not storing value


Macrura
 Share

Recommended Posts

this is the 2nd time i have encountered this issue; the first time i just figured i was doing it wrong;

when making the options in a select list, it says:

Each option should be typed on it's own line. If you would like an option/label pair, use := to separate the values. For instance 1:=Poor, 2:=Excellent. The value stored in the database would be the first part of the pair (1 and 2 respectively) and the latter would be displayed in the dropdown.

this is my list:

engus:=English (US)

enguk:=English (UK)

french:=French

italian:=Italian

spanish:=Spanish

greek:=Greek

but for some reason this is not working...it doesn't store the value when using this kind of list. Does it only work with numbers?, or can we have the stored data be the string on the left (which could be a css class for example) and on the right be able to use a word combination that is more understandable to the user...

-marc

Link to comment
Share on other sites

OK - right, this is in fact the select module by Hani, (got so used to installing that,forgot it was a separate module..);

But i can confirm that the option/value feature of this module doesn't work for me, or if it does, the code might need to be updated to allow for changes to the list after the initial setup; It works fine if you don't have the option/value pair;

I guess i'm going to start using apeisa's suggestion, since it will enable the end users to add options without having to go in and edit a field; I usually have a hidden 'settings' page with the global site settings, so i have seen it suggested elsewhere in the forum to setup a child page within that settings page, and below that define dropdown options; so in my case i would have a child page of settings called 'language choices' and then each of those could contain the option/value pair...

-marc

  • Like 1
Link to comment
Share on other sites

When you are using Form Builder, all of ProcessWire's single-and-multiple selection Inputfields provide a very similar means of defining the options. But this applies only to forms in Form Builder.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...