首页 > 解决方案 > HTML 表单只读错误

问题描述

我是 HTML 新手。我正在尝试创建一个包含只读纯文本和输入的内联表单。但是,我的输出的某些部分丢失了。预期的 {{i}} 是 ('I', 'body') 输出是 ('I', 任何人都可以提出问题所在吗?谢谢

这是我前端的 jpeg

我的html文件:

<p> Please select the relevant dependency that will add to your output </p>
    {% for i in extraction %}
    {{i}}
    <form class="form-inline">
        <div class="form-group mb-2">
          <label for="sampledependency" class="sr-only">Dependency</label>
          <input type="text" readonly class="form-control-plaintext" id="sampledependency" value={{i}}>
        </div>
        <div class="form-group mx-sm-3 mb-2">
          <label for="inputpolarity" class="sr-only">Polarity</label>
          <input type="text" class="form-control" id="inputpolarity" placeholder="Polarity">
        </div>
        <button type="submit" class="btn btn-primary mb-2">Add</button>
      </form>
    {% endfor %}

这是从烧瓶渲染的 html_template:

return render_template('annotation.html', 
                            first_sentence = first_sentence, 
                            extraction = [('I', 'body'),('d', 'adasd')])

标签: htmlbootstrap-4

解决方案


推荐阅读