This project is not covered by Drupal’s security advisory policy.

Allows a user to select data stored into a large database with dependent selection choice (e.g. Country -> City)

In other words, this is a dependent drop down with a static data set consisting of the keys (which will be used for the first input selector) and the values (which will be in the dependent drop down).

If the database's values do not uniquely identify a specific key, you may well want to save the key as well as the value itself, in which case, select "multiple values" and the key and the value will be saved as separate values.

So, for example, you could have a database of all French codes postals - which cover several towns.

So, create a new field type, using this type (fixed data dropdown), You will need to use the admin form to "submit" your database - you'll need some regular expression magic at this point to extract the data from your database....

Ok, so now, in theory, you have a nice bug data set in your drupal database, which will not interfere with any other data in there (this was a design decision, I tried using a very large taxonomy, and it just made things awkward, it worked, but it was just a pain to have lying about)....

So, now, when you use the field on a form to actually enter data you will have an auto-complete text-field that you will use for the "key" (i.e. in this case, the codes postal), and then you will get a list of the values associated with that key (in this case, the towns covered by that codes postal).

Thats it,

I hope it helps.

Just to re-iterate, as I suspect people will ask, if you want the key and the value stored, select "multiple values".

some FAQ's
--------------

1/ How do I get it to display the key and the value?
A: You select "multiple values" - note, this is not a perfect solution, it may be better to re-write the module so that the key and the value can have different labels, this isn't currently possible. The Key will always be the second value (which again may not be what you want when it is printed out) - you can of course theme it the way you want it.

2/ How do I have another field that uses the same database?
Simply re-use the same field you created the first time - dont create a new one.

3/ Where are all the admin options?
There aren't any, once you create a CCK field of this type, you will be presented with all the options

Project information

  • Created by markfoodyburton on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases