Ajax autocomplete field is not saving data

Support General Ajax autocomplete field is not saving data

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #43475
    netalysnetalys
    Participant

    Hello !
    I've created an autocomplete field that populates results with AJAX from an API.
    The fields is well populated : https://imgur.com/ryhJuEJ
    When I select a line, it's well displayed underneath the list : https://imgur.com/5eB5ZvW
    In the code, the value is correct : https://imgur.com/88bOc6e

    But when I Save the post, nothing is stored in the database.
    I've tested with static data and it works fine...

    Can you help me understand why ?
    Thanks !

    #43480
    netalysnetalys
    Participant

    OK, it works if I set this option in my field : 'sanitize_callback' => 'none',

    Is there a way to display the value here after saving ?
    Saved data

    #43481
    netalysnetalys
    Participant

    https://imgur.com/2WhDOCN

    #43491
    PeterPeter
    Moderator

    Hello,

    Does the returned data from API have the format 'value' => 'Label' like the static data? Also, the value should be in lowercase, with no special characters. Read more in the documentation https://docs.metabox.io/fields/autocomplete/#settings

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.