how to make the <a> link </a>
tag work with a submit button?
right now send data with a form, but I also need the <a> link </a>
link to work
My code only works the submit button
<form method="POST" action="{{ route('enviado') }}">
@csrf
<input type="hidden" name="id" value="{{$hoy->id}}">
<a href="https://api.whatsapp.com/send" target="_blank"> <button type="submit">Send</button></a>
</form>
help pls
CodePudding user response:
Perhaps you can try removing the <a>
tag and just use this on your <form>
tag
<form method="POST" action="{{ route('enviado') }}" onsubmit="window.open('https://api.whatsapp.com/send', '_blank');">