{% load staticfiles %}
<form id="searchForm" action="{% url 'search_html' %}" method="post">{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Search" />
</form>
<script type="text/javascript">
var w='<img src="{% static "images/wait1.gif" %}">';
var options = {
dataType: 'html',
beforeSubmit: function() {$("div#search_results").html(w + " " + $('label[for='+$('input[name=target]:radio:checked').attr("id")+']').text());},
success: function(data) {
$('div#search_results').html('<table id="tableSearchResults">' + data + '</table>');
$('#tableSearchResults').dataTable();
},
error: function (data) {alert("Error");}
};
$("div#search").tabs();
$("form#searchForm").ajaxForm(options);
</script>