button not responding when click but when press return key than works

22 views
Skip to first unread message

Asif Khan

unread,
Jun 13, 2018, 5:14:48 PM6/13/18
to Django users
I am having amazing problem in my django template. Button does not respond on pressing click on it. It works when I press return key. code is following. 
{% extends 'vtapp/baseapp_layout.html' %}

{% block head %}
<title>Vehicle Vegilince - Customer Search</title>
{% endblock %}

{% block content %}
<h3>Enter Customer information</h3>
<form method="post" action="{% url 'vtapp:vtsearch' %}">
{% csrf_token %}
<div class="form-group">
<div class="col-lg-5">
<input type="text" name="custsrh" class="form-control" placeholder="Enter CNIC / mobile phone">
</div>
<label class="col-lg-2">
<buton type="submit" class="btn btn-danger">Search</buton>
</label>
</div>
</form>

Julio Biason

unread,
Jun 13, 2018, 5:19:20 PM6/13/18
to django...@googlegroups.com
Hi Asif,

Are you sure you don't have any JS capturing the submit press and doing `preventDefault()`? That would prevent the button from sending the form.

On Firefox, if you inspect the button, if it shows an "EV" near it, it means there is something capturing the button events -- and `click` could be one of those events, with the preventDefault().

--
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...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ea697019-42b8-4f66-8658-36f26ba3493a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Julio Biason, Sofware Engineer
AZION  |  Deliver. Accelerate. Protect.
Office: +55 51 3083 8101  |  Mobile: +55 51 99907 0554

Asif Khan

unread,
Jun 13, 2018, 6:14:34 PM6/13/18
to Django users
No I am not using JS capturing for any kind of actions. where as my other form button are working.

Fidel Leon

unread,
Jun 14, 2018, 1:53:22 AM6/14/18
to django...@googlegroups.com
If I remember correctly, the correct tag for a button is [obviously] <button>, no <buton> (please see the missing T).

--
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...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

For more options, visit https://groups.google.com/d/optout.


--

kanishk tanwar

unread,
Jun 14, 2018, 7:38:10 AM6/14/18
to Django users
Yea t is missing i suggest use atom it has nice auto completion for the tags :D

Asif Khan

unread,
Jun 14, 2018, 8:58:16 AM6/14/18
to Django users
Hi Fidel. thanks to notice such a minute mistake which I did not. Yes it is working now.
Reply all
Reply to author
Forward
0 new messages