3 years ago

Form with delete button vs Span element

Posted 3 years ago by George12


I just saw this tutorial which 'encourages' - I think - to have a form with only a button for deletion like this

<form method="POST" 
    {{ method_field('DELETE') }}
    {{ csrf_field() }}

    <button type="submit">Delete Post</button>

until now i was using the following code

            <span @click="deletePost(post)" >Delete post</span>

Both approaches work fine but I am more interested in good practices so I was wondering which is the best approach and why? Which one do you use?

Please sign in or create an account to participate in this conversation.