there is a menu with 5 select key in my HTML program . By clicking each of these keys a request should send to server . I use ‘a’ tag and href for this . by this approach i have to send request with GET method but i want use POST . For sending request by POST , I use ‘form’ tag for each of these keys . so for 5 key i use 5 ‘form’ tag . Is this a common and acceptable way? haven’t i any better way for sending request with POST? thanks
<form action="{{url('/defineProject')}}" method="POST" enctype="multipart/form-data">
{{ csrf_field() }}
<input id="a1" class="s1" type="submit" value="define project">
</form>
<form action="{{url('/deleteProject')}}" method="POST" enctype="multipart/form-data">
{{ csrf_field() }}
<input id="a2" class="s1" type="submit" value="delete project ">
</form>
<form action="{{url('/upgradeProject')}}" method="POST" enctype="multipart/form-data">
{{ csrf_field() }}
<input id="a3" class="s1" type="submit" value="upgrade project ">
</form>
<form action="{{url('/reportProject')}}" method="POST" enctype="multipart/form-data">
{{ csrf_field() }}
<input id="a4" class="s1" type="submit" value="report Project">
</form>
<form action="{{url('/editProject')}}" method="POST" enctype="multipart/form-data">
{{ csrf_field() }}
<input id="a5" class="s1" type="submit" value="edit project">
</form>
2
Answers
maybe this is the answer you looking for?
<form method="POST"></form>
I guess this should work.