I have created a Field widget for Text fields in a content type. If a URL is entered into the text field, an ajax event callback is triggered on change and the URL is parsed to fetch the Open Graph tags if they exist in the field.
The ajax callback also converts the OG tag image link to an image tag and appends it to the wrapper of the field. However I am not able to save the parsed image value. I would like to save it as the parsed image value.
I am thinking of adding a hidden text field that would save the parsed field value by allowing the ajax callback to append the new image tag to that field . Or better perhaps save this image value to another field in the content type like the text area.
What other solutions are recommended for this problem?