0

I'm creating one-page checkout in Laravel 7, it has three forms,

  1. Customer info
  2. Shipping info
  3. Payment Info

I have followed This answer but it not working. Do I need to submit a form on the same action? My HTML code:

<form method="POST" action="{{route('shipping.info')}}" id="customer_info">
...
</form>
<form method="POST" action="{{route('shipping.info')}}" id="shipping_info">
...
</form>
<form method="POST" action="{{route('shipping.info')}}" id="payment_info">
...
</form>

Controller code:

public function shippingInfo(CombineCheckoutReq $request){
    $validatedData = $request->validated();   
    dd($validatedData);
}
Arunendra
  • 570
  • 2
  • 10
  • 34
  • Can't you merge the three forms into one? – apokryfos Jul 25 '20 at 06:41
  • @apokryfos I have a further form to update items if I will use the single form then there will more forms inside the main form. – Arunendra Jul 25 '20 at 06:48
  • You can only submit one form at one time and you can't nest forms. These are HTML restrictions. The post you linked is not about submitting multiple forms but about applying multiple form validation rules on a single form, so you will either need to merge the forms, or do other JavaScript trickery to achieve what you want – apokryfos Jul 25 '20 at 06:52

0 Answers0