Page 1 of 1

JSON example for SelectBox

Posted: Fri May 13, 2016 9:08 am
by k2R400
Hello,

I try to load a Select Box from a choice URL.
Below a JSON who work perfectly with an auto complete text box, but not with a Select Box

Code: Select all

{
    "success": true,
    "response": {
        "results": [
            {
                "option": "Monsieur",
                "value": 1
            },
            {
                "option": "Madame",
                "value": 2
            },
            {
                "option": "Mademoiselle",
                "value": 3
            }
        ]
    }
}
Can you post an exemple of a valid JSON for a Select Box ?

TY in advance

Re: JSON example for SelectBox

Posted: Fri May 13, 2016 1:00 pm
by SeanTyree
Patrick,

The formatting for the select box json should be:

Code: Select all

{
    "success": true,
    "response": [
            new Option("Monsieur", "1"),
            new Option("Madame", "2"),
            new Option("Mademoiselle", "3")
    ]
}
Sean

Re: JSON example for SelectBox

Posted: Fri May 13, 2016 2:15 pm
by k2R400
Thank you Sean !!!