laravel-form-builder icon indicating copy to clipboard operation
laravel-form-builder copied to clipboard

[Question] - How to make form with 2 or 3 columns?

Open sangnguyenplus opened this issue 6 years ago • 1 comments

Hi @kristijanhusak,

Thanks for your great package.

My admin template form has 3 bootstrap column (col-md-9 & col-md-3). I don't know how to separate form fields into 2 parts.

Ex:

$this->container('left_form')->add(...)->add(..)->container('right_form')->add(...);

If your package is not including that feature, please help me add it if you can :)

Thank you!

sangnguyenplus avatar Mar 24 '18 06:03 sangnguyenplus

You can split them up in view.

{{! form_start($form) !}}
<div class="row">
  <div class="col-md-9">
    {{! form_row($form->left_field_1) !}}
    {{! form_row($form->left_field_2) !}}
  </div>
  <div class="col-md-3">
    {{! form_row($form->right_field_1) !}}
    {{! form_row($form->right_field_2) !}}
  </div>
</div>
{{! form_end($form) !}}

Or if you use child forms, you can just print one form in left side, and another form in right side.

kristijanhusak avatar Apr 26 '18 05:04 kristijanhusak