Wednesday, September 23, 2015

Get django data filtered by javascript input text

Hello all genius developers of django, I am a fresh user of django and I don't know how can I display data from django by input text form in html. Here is my javascript code, I want to display data by value inputted in input text form.  

                           <script type="text/javascript">
function date(ele){
if(event.keyCode == 13){
{% for d in data %}
{% if d.date == ele.value %}
<tr onclick="jumpToEdit({{ d.id }})">
<td>{{ d.date }}</td>
<td>{{ d.name }}</td>
<td onclick="drawSingle()">{{ d.weight }}</td>");
<td>{{ d.temp }}</td>
        <td>{{ d.pressure }}</td>
        <td>{{ d.pulse }}</td>
             <td><a href="/delete/{{ d.id }}"><img src="images/trash_icon.png" /></a></td>
</tr>
{% endif %}
{% endfor %}
}
}
</script>

Best regards,


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/66243b89-58b3-4517-b27e-a07867c1f9c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment