...
The choices URL property allows you to use a web service to return your choice options and values by passing them using JSON formatting. A PHP script would be one example of a service used to pass the values to your application. When using the choices url property, all database-driven auto-complete properties are ignored.
Good JSON Syntax Example
These are values returned from an auto-complete textbox in a good example of JSON formatting:
Code Block |
---|
{ "success": true, "response": { "colWidths": [ 41, 7 ], "results": [ { "00001": "Alpineaire Food, 58", "CATID": "58" }, { "00001": "Altimiters, 13", "CATID": "13" }, { "00001": "Avalanche Gear, 82", "CATID": "82" } ] } } |
JSON Error Example
This is the information returned using JSON format to report an error with an auto-complete textbox.
Code Block |
---|
{ "success": false, "errorId": "08001", "errorText": "Authorization failure on distributed database connection attempt. SQLCODE=-30082" } |
If you are unable to get any information to display on your choice URL script you can use the showErrors() API to try and debug the reason the auto-complete is unable to display results.
showErrors() API Documentation
Example of the showErrors() API displaying the JSON error example: