Laravel刀片形式关闭问题 [英] Laravel blade form closing issue

查看:96
本文介绍了Laravel刀片形式关闭问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Laravel中有一个这样的表格:

I have a form in Laravel like this:

    <div class="modal-body">
          {!! Form::model($questionGroup, ['route' => ['question_groups.update', $questionGroup->id, 'model_slug' => 'assessments', 'model_id' => $assessment->id], 'method' => 'patch']) !!}
          <p>TEST</p>
          {!! Form::close() !!}
    </div>

这会在我的源代码中输出以下内容:

This outputs the following in my source:

<div class="modal-body">
   <form method="POST" action="http://localhost:8000/admin/question_groups/7?model_slug=assessments&amp;model_id=1" accept-charset="UTF-8"></form>
   <input name="_method" type="hidden" value="PATCH">
   <input name="_token" type="hidden" value="E6HzCmQvRGds6eETgdCv5KCsf0eyOtjxvqnidrTx">
   <p>TEST</p>
</div>

我不知道为什么表单无法正确关闭.有任何想法吗?我使用的是Laravel 5.5,此表单位于Bootstrap模式中.

I have no idea why the form is not closing properly. Any ideas? I'm using Laravel 5.5 and this form is in a Bootstrap Modal.

此处是完整html的链接: https://gist.github.com/shabaz-ejaz/96be7b4b20ba9146436f1f9f1d274211

Here is a link to the full html: https://gist.github.com/shabaz-ejaz/96be7b4b20ba9146436f1f9f1d274211

文件很大,因此请搜索 question_groups.update ,这是表格开始的位置.

The file is quite big so search for question_groups.update and that is where the form begins.

推荐答案

该问题与格式不正确的HTML有关.

The issue was related to non well-formed HTML.

我的模态是在这样的表中:

My modal was inside a table like this:

<table>
   <tbody>
       <tr>
        <td></td>
        <td></td>
       </tr>

        <form ...>

        </form>

    </tbody>
</table>

一旦将< form> 放在< td> 内,它就可以正常工作.

Once I placed the <form> inside the <td> it worked fine.

这篇关于Laravel刀片形式关闭问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆