Django ajax-generated hidden field not in request.POST
I'm using https://drew.tenderapp.com/faqs/autosuggest-jquery-plugin/options-api to render an autocomplete field:
<h1>Quick Tags</h1>
<div class="fieldset">
{{ vocabularies.vocabulary_1.errors }}
<p>{{ vocabularies.vocabulary_1 }}</p>
<script type="text/javascript">
////http://code.drewwilson.com/entry/autosuggest-jquery-plugin
$("input#id_vocabulary_1").autoSuggest("/staff/taxonomy/ajax", {selectedItemProp: "name", selectedValuesProp: "nam开发者_如何学JAVAe", searchObjProps: "name", startText: "Enter terms.", keyDelay: 50, minChars: 1, queryParam: "term", asHtmlID: "vocabulary_1", extraParams: "&app=taxonomy&model=TaxonomyData&vocabulary=1"});
</script>
</div>
Which renders a hidden field:
<li class="as-original" id="as-original-vocabulary_1">
<input id="vocabulary_1" type="text" name="vocabulary_1" maxlength="200" autocomplete="off" class="as-input">
<input type="hidden" class="as-values" name="as_values_vocabulary_1" id="as-values-vocabulary_1" value="test,new term,">
</li>
However, the values from this field are not present in the POST dictionary. What could be causing this problem?
I found out the problem; if the div that contains the form opening tag is closed, all fields after that are not contained in the POST dictionary.
精彩评论