skip to Main Content

The Twitter Bootstrap Form Wizard requires a <form class="form-horizontal mt-sm" action='' method="POST">for every tab.

I have changed it into {{ Form::open(['route' => 'myroute', 'class' => 'form-horizontal mt-sm']) }}

Do I need to do a {{ Form::close() }} for each of these? Since there’s only one submit button at the end, what would be the right way to go about this then? Just one form closing? Or one for each opening?

3

Answers


  1. Chosen as BEST ANSWER

    I tried both answers above, but then a hybrid version worked for me, whereby I had multiple {{ Form:: open() }} but only one {{ Form::close() }}. There was only one {{ Form::submit() }} before the form closure.


  2. You need to use {!! Form::close() !!} closing clause for each opening one:

    {!! Form::open() !!}
    {!! Form::model() !!}
    
    Login or Signup to reply.
  3. If you have only one submit button, you need to open it only once, so your code will be:

    {!! Form::open(['class' => 'form-horizontal']) !!}
        <div class="mt-sm">
            <input type="text" name="item1">
        </div>
        <div class="mt-sm">
            <input type="text" name="item2">
        </div>
        {!! Form::submit() !!}
    {!! Form::close() !!}
    

    Hope this works!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search