"Remove" button in the form, Shrine not deleting attachment

Hi! I’m using Shrine to attach profile pictures to users. Direct uploads with S3/Uppy etc work fine, so I can attach the avatars. In the same form I have a “Remove” button, that is supposed to remove the avatar when the user successfully submits the form. What should this button do with JavaScript so that this happens? What value should it set the hidden field to? When the value is an empty string nothing happens and the avatar remains attached to the user.


Hi, if you want to remove the attachment via a form field, you should use the remove_attachment plugin. This gives you a separate attribute to which you can assign a truthy value like "true" or "1" in order to remove the attachment.

That did the trick. Thanks! :slight_smile: