newism / craft3-fields

Address, telephone, email, embed and gender fields for CraftCMS 3.x
Other
54 stars 16 forks source link

Provide Auto-complete config sample? #1

Closed mikestecker closed 7 years ago

mikestecker commented 7 years ago

Could you provide an auto-complete configuration example? I've tried putting in some parameters in a few different ways but it keeps complaining it's not proper JSON.

I've tried it this way:

types: ['(cities)'],
componentRestrictions: {country: "us"}

and also this way:

{
types: ['(cities)'],
componentRestrictions: {country: "us"}
}

but still no dice. It keeps telling me The JSON string supplied is not valid: Syntax error</code>

leevigraham commented 7 years ago

Valid JSON requires keys and values to be quoted with double quotes:

{
    "types": ["cities"],
    "componentRestrictions": {
        "country": "us"
    }
}

Looks like I need to actually implement this functionality. I added the settings but they are not being applied in the JS.