th3o6a1d
th3o6a1d

Reputation: 57

Missing textarea in form post using 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>

I'm using a jQuery plugin to turn a textarea into a tag-enabled input box, using TextExt 1.3.1. It's an awesome plugin and I don't want to have to part with it, but when I enable the plugin, my textarea disappears from the form POST data. I've triple-checked the id, and since the plugin is working just fine, I can't figure out why the textarea data doesn't get submitted with the form. I'm currently using django template processing, so you'll notice the CSRF tag.

Here is the source as seen by the browser:

<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

Upvotes: 0

Views: 443

Answers (0)

Related Questions