Child: [77df3f] (diff)

Download this file

search.html    21 lines (19 with data), 1.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{% 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>