Home Forums Backend Issues (wp-admin) jQuery Auto Populate Reply To: jQuery Auto Populate

  • Hi @bobz

    I think the issue is that because on page load, the select field does not contain any value because it has no option element to select.

    This means, your JS can’t find the origional value to select when you update the DOM with new option elements.

    Perhaps in your PHP AJA function, you can lookup the value for the field, and include this ‘selected’ data for the option you want selected.

    To do this, you will need to change the way you post pack your data as a comma separated string wont allow for this kind of data.

    Try using JSON to return an array of items, plus the selected value if it has one!

    Does that help?