Using wp media library with forms

I want to create an update form, where user selects a media or image from media library and the link is automatically added to the text field.

<input type=”text” name=”selevalue.
img” value=” this will be the link of the image the user selected from media”> <button> Browse</button>

the browse button if clicked will open the wp media library, and the link of any image the user selected will be added to the text field as value Please any guide on how to archive this?

Source link