gentelella bootstrap模板 - textarea

时间:2017-08-04 04:45:24

标签: textarea toolbar bootstrap-4 gentelella

任何人在使用gentelella管理员模板之前(https://github.com/puikinsh/gentelella)?我正在尝试使用此模板https://colorlib.com/polygon/gentelella/form.html中的textarea,但它不允许我将数据保存到数据库。内容将位于div内,隐藏textarea

Textarea代码将如下所示。

<div class="x_content">
<div id="alerts"></div>
<div class="btn-toolbar editor" data-role="editor-toolbar" data-target="#editor-one">
    <div class="btn-group">
        <a class="btn dropdown-toggle" data-toggle="dropdown" title="Font"><i class="fa fa-font"></i><b class="caret"></b></a>
        <ul class="dropdown-menu">
        </ul>
    </div>

    <div class="btn-group">
        <a class="btn dropdown-toggle" data-toggle="dropdown" title="Font Size"><i class="fa fa-text-height"></i>&nbsp;<b class="caret"></b></a>
        <ul class="dropdown-menu">
            <li>
                <a data-edit="fontSize 5">
                    <p style="font-size:17px">Huge</p>
                </a>
            </li>
            <li>
                <a data-edit="fontSize 3">
                    <p style="font-size:14px">Normal</p>
                </a>
            </li>
            <li>
                <a data-edit="fontSize 1">
                    <p style="font-size:11px">Small</p>
                </a>
            </li>
        </ul>
    </div>

    <div class="btn-group">
        <a class="btn" data-edit="bold" title="Bold (Ctrl/Cmd+B)"><i class="fa fa-bold"></i></a>
        <a class="btn" data-edit="italic" title="Italic (Ctrl/Cmd+I)"><i class="fa fa-italic"></i></a>
        <a class="btn" data-edit="strikethrough" title="Strikethrough"><i class="fa fa-strikethrough"></i></a>
        <a class="btn" data-edit="underline" title="Underline (Ctrl/Cmd+U)"><i class="fa fa-underline"></i></a>
    </div>

    <div class="btn-group">
        <a class="btn" data-edit="insertunorderedlist" title="Bullet list"><i class="fa fa-list-ul"></i></a>
        <a class="btn" data-edit="insertorderedlist" title="Number list"><i class="fa fa-list-ol"></i></a>
        <a class="btn" data-edit="outdent" title="Reduce indent (Shift+Tab)"><i class="fa fa-dedent"></i></a>
        <a class="btn" data-edit="indent" title="Indent (Tab)"><i class="fa fa-indent"></i></a>
    </div>

    <div class="btn-group">
        <a class="btn" data-edit="justifyleft" title="Align Left (Ctrl/Cmd+L)"><i class="fa fa-align-left"></i></a>
        <a class="btn" data-edit="justifycenter" title="Center (Ctrl/Cmd+E)"><i class="fa fa-align-center"></i></a>
        <a class="btn" data-edit="justifyright" title="Align Right (Ctrl/Cmd+R)"><i class="fa fa-align-right"></i></a>
        <a class="btn" data-edit="justifyfull" title="Justify (Ctrl/Cmd+J)"><i class="fa fa-align-justify"></i></a>
    </div>

    <div class="btn-group">
        <a class="btn dropdown-toggle" data-toggle="dropdown" title="Hyperlink"><i class="fa fa-link"></i></a>
        <div class="dropdown-menu input-append">
            <input class="span2" placeholder="URL" type="text" data-edit="createLink" />
            <button class="btn" type="button">Add</button>
        </div>
        <a class="btn" data-edit="unlink" title="Remove Hyperlink"><i class="fa fa-cut"></i></a>
    </div>

    <div class="btn-group">
        <a class="btn" title="Insert picture (or just drag & drop)" id="pictureBtn"><i class="fa fa-picture-o"></i></a>
        <input type="file" data-role="magic-overlay" data-target="#pictureBtn" data-edit="insertImage" />
    </div>

    <div class="btn-group">
        <a class="btn" data-edit="undo" title="Undo (Ctrl/Cmd+Z)"><i class="fa fa-undo"></i></a>
        <a class="btn" data-edit="redo" title="Redo (Ctrl/Cmd+Y)"><i class="fa fa-repeat"></i></a>
    </div>
</div>

<div id="editor-one" class="editor-wrapper"></div>

<textarea name="descr" id="descr" style="display:none;"></textarea>

我可以使用工具栏的所有功能,并可以编辑内容。但我无法保存到数据库。

执行中是否有任何错误?有什么建议吗?

1 个答案:

答案 0 :(得分:-2)

你应该把textarea放到这样的表格标签中:

{{1}}

您也可以设置表单属性:https://www.w3schools.com/tags/tag_textarea.asp

请注意您的数据库属性,textarea可以容纳无限数量的字符..