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 get the Open Graph tags if they exist in the field.
The ajax callback also converts the image link from the OG tag to an image tag and adds it to the field container. However, I cannot save the value of the scanned image. I would like to save it as the parsed image value.
I'm thinking of adding a hidden text field that would save the value of the parsed field by allowing the ajax callback to add the new image tag to that field. Or better perhaps save this image value in another field in content type like text area.
What other solutions are recommended for this problem?