Leteo's avatar
Level 1

Confirmation box for a link

Hello,

a blade form shows to the user the following link


  <a role="button"  class="btn btn-primary btn-sm " href="{{ route('pdf') }}">Download Application form</a> 

This link routes the user to a controller, which downloads a pdf file.

I would like to ask for confirmation with a dialog box: ok, cancel and a message, but I do not manage to achieve this with the given link. Is there a way to achieve this with a link? I am using also bootstrap

Thank you

0 likes
2 replies
jlucia's avatar

This should be a quick and easy way.

<a role="button" class="btn btn-primary btn-sm" href="{{ route('pdf') }}" onclick="return confirm('Are you sure?')">Download Application form</a>
1 like

Please or to participate in this conversation.