• vipplayer

    (@vipplayer)


    Hi
    Can I give the value of one field at the expense of the second? For example, there is a field State and City where when filling in the field Sity entering “Moscow”, in the field State was Russian and so with all cities/countries? Maybe u have a addition to plagins where there is all the necessary information about the countries and cities?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author xnau webdesign

    (@xnau)

    Something like this requires a custom template and some javascript to dynamically change the options available. I have a tutorial that explains a simple way to do this that might work for you:

    Dropdown Selectors: limit selections based on another selector

    Thread Starter vipplayer

    (@vipplayer)

    Sorry but I don’t understand how the code should work in the end? Do you have an example? if in the field insert ” Alabama:: AL, Alaska:: AK, American Samoa:: AS, Arizona:: AZ,
    Arkansas:: AR, California:: CA ” even without the introduction of any scripts displays as in the picture in the documentation

    Plugin Author xnau webdesign

    (@xnau)

    The article linked above contains an example. In the example, the “state” field displays normally, but the “city” field has it’s available options modified when a “state” is selected. This is done by only showing the city optgroup for the matching state.

    It works by having optgroups in the child field that match values in the parent field.

    I hope that helps…

    Thread Starter vipplayer

    (@vipplayer)

    Hmm. That is, I can not thus affect the second field based on the data entered in the first field?

    Thread Starter vipplayer

    (@vipplayer)

    If you don’t know what I mean, for example. :
    I have a field “City” (which is not filled by the user) and based on the data entered, for example “Washington” in the field with the Country (which fills the user) is automatically assigned to the United States
    and so with all countries and cities of the globe

    • This reply was modified 6 years ago by vipplayer.
    Plugin Author xnau webdesign

    (@xnau)

    Oh, I see. Of course, this is possible, you will need to have your cities and states organized with optgroups so your javascript can know which value to use to update the other fields.

    You’ll need to write the code for that from scratch, I don’t have an example of how you’d do this, but using jQuery it’s pretty simple.

    Thread Starter vipplayer

    (@vipplayer)

    do I just create my own plugin-add-on to yours?

    • This reply was modified 6 years ago by vipplayer.
    Plugin Author xnau webdesign

    (@xnau)

    This is something that you would put into a custom list template, not a plugin.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘autocomplete’ is closed to new replies.