使用TextExt在表单中缺少textarea

时间:2013-07-15 02:19:25

标签: javascript jquery django jquery-textext

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
<script src="/static/js/textext.js" type="text/javascript"></script>

<form name="submission" onsubmit="" action="/my_content/{{set.id}}/add/" method="POST">
{% csrf_token %}
<textarea rows="5" class = "input-block-level" width=100% input type="text"     name="front" id="front" placeholder="Question..." required></textarea>
<textarea class = "input-block-level" rows="5" input type="text" name="back" id="back" placeholder="Answer..." required></textarea>
<textarea class = "input-block-level" id="category" name="category" placeholder =""     rows="1" ></textarea>
<button type="submit" class="btn btn-info">Submit</button>
</form>

<script>
    $('#category').textext({...etc...
</script>

我正在使用jQuery插件将textarea转换为启用标签的输入框,使用TextExt 1.3.1。这是一个很棒的插件,我不想让它分开,但是当我启用插件时,我的textarea从表单POST数据中消失了。我已经三次检查了id,并且由于插件工作得很好,我无法弄清楚为什么textarea数据不会随表单一起提交。我目前正在使用django模板处理,所以你会注意到CSRF标签。

以下是浏览器看到的来源:                       

<table class="table"><thead>
<h3><a href="/my_content/">My Content</a> > <a href="/my_content/31/">asdf</a></h3>
<form name="submission" onsubmit="" action="/my_content/31/add/" method="POST">
   <div style='display:none'><input type='hidden' name='csrfmiddlewaretoken' value='3onHid0y5LCQDM71Zxd45GURxOl5cjgl' /></div>
   <input type="hidden" />
<div class="well">  
    <textarea rows="5" class = "input-block-level" width=100% input type="text" name="front" id="front" placeholder="Question..." required></textarea>
    <span class="help-block"></span></div>
            <div class="well">
            <textarea class = "input-block-level" rows="5" input type="text" name="back" id="back" placeholder="Answer..." required></textarea>
            <textarea class = "input=block-level" id="category" name="category" placeholder ="" rows="1" ></textarea>
        <span class="help-block"></span></div>
<button type="submit" class="btn btn-info">Submit</button>
</form>
Items: 26

0 个答案:

没有答案