Button Event

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Button Event

Mayur Bagul
Hello Community,

Im looking for solution on Button Event.
I have situation like mention below :

i have one button check temperature. after clicking on it; it should display dummy temperature on template from view.py i wrote.  
but im not getting how i can do this because there is no javascript used in django.

Please guide me to get rid of this impedance.

Thanking you,
Mayur Bagul. 

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/3a9d8006-ab98-44e4-a2ce-66e4a439cd9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Button Event

aishtiaque
Hi Mayur, 

I'm not sure what you mean by "there is no javascript in django" because I use it all the time. JS is not tied to Django in any way since its operations are usually client-side and so it can be used inside your Django templates. 

In any case, you can have JS code in your template inside <script> tags, where you can asynchronously send a request to your relevant view using the Fetch API, then process the data and display it on your template.

Hope this helps! 

Best,
Ahmed

On Mon, Apr 29, 2019 at 1:03 PM Mayur Bagul <[hidden email]> wrote:
Hello Community,

Im looking for solution on Button Event.
I have situation like mention below :

i have one button check temperature. after clicking on it; it should display dummy temperature on template from view.py i wrote.  
but im not getting how i can do this because there is no javascript used in django.

Please guide me to get rid of this impedance.

Thanking you,
Mayur Bagul. 

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/3a9d8006-ab98-44e4-a2ce-66e4a439cd9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAKizqR5AkgSGxc%2BPtNrGnwsh6938T0SfCBKyW%2BMt6289YmFuXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Button Event

Mayur Bagul
Thanks Ahmed,

can you please provide me resource to learn  how to use java script and events in django Templates?
Because im not getting proper resource how to use java script in django.

Actually on one web page there will be one button after clicking on that button i want to merge another web page inside  current one.
can you help me with that?

Thanking you






On Monday, April 29, 2019 at 11:03:35 PM UTC+5:30, Ahmed Ishtiaque wrote:
Hi Mayur, 

I'm not sure what you mean by "there is no javascript in django" because I use it all the time. JS is not tied to Django in any way since its operations are usually client-side and so it can be used inside your Django templates. 

In any case, you can have JS code in your template inside <script> tags, where you can asynchronously send a request to your relevant view using the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FFetch_API%2FUsing_Fetch\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9bmP6SMm4rsVL8C4BNL1m15Jyog&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FFetch_API%2FUsing_Fetch\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9bmP6SMm4rsVL8C4BNL1m15Jyog&#39;;return true;">Fetch API, then process the data and display it on your template.

Hope this helps! 

Best,
Ahmed

On Mon, Apr 29, 2019 at 1:03 PM Mayur Bagul <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="3mjiFo0gAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mayur...@...> wrote:
Hello Community,

Im looking for solution on Button Event.
I have situation like mention below :

i have one button check temperature. after clicking on it; it should display dummy temperature on template from view.py i wrote.  
but im not getting how i can do this because there is no javascript used in django.

Please guide me to get rid of this impedance.

Thanking you,
Mayur Bagul. 

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="3mjiFo0gAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="3mjiFo0gAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django...@....
Visit this group at <a href="https://groups.google.com/group/django-users" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;">https://groups.google.com/group/django-users.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-users/3a9d8006-ab98-44e4-a2ce-66e4a439cd9d%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-users/3a9d8006-ab98-44e4-a2ce-66e4a439cd9d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-users/3a9d8006-ab98-44e4-a2ce-66e4a439cd9d%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-users/3a9d8006-ab98-44e4-a2ce-66e4a439cd9d%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/6e236b20-0774-44ee-9012-1b036c1dd920%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Button Event

Suresh Kannan
In reply to this post by Mayur Bagul
Hi,

Have a look at this https://stackoverflow.com/questions/298772/django-template-variables-and-javascript

There are also several tutorials in youtube as well.

On Mon, Apr 29, 2019 at 1:03 PM Mayur Bagul <[hidden email]> wrote:
Hello Community,

Im looking for solution on Button Event.
I have situation like mention below :

i have one button check temperature. after clicking on it; it should display dummy temperature on template from view.py i wrote.  
but im not getting how i can do this because there is no javascript used in django.

Please guide me to get rid of this impedance.

Thanking you,
Mayur Bagul. 

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/3a9d8006-ab98-44e4-a2ce-66e4a439cd9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CANfVfcDr0bwRm68N6P5HFvHYKm7VWCtdNew7_cw%2BUZaVMRLQ0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Button Event

Joel Mathew
In reply to this post by Mayur Bagul
Templates expand into html. So you just write javascript like you normally do. You call javascript from within your templates by using something like:

<script src="{% static 'clinic/userjs/stockentry.js' %}?dev={{ rnd_num }}"></script>

Here, I am using {% load static %}
Sincerely yours,

 Joel G Mathew



On Tue, 30 Apr 2019 at 12:05, Mayur Bagul <[hidden email]> wrote:
Thanks Ahmed,

can you please provide me resource to learn  how to use java script and events in django Templates?
Because im not getting proper resource how to use java script in django.

Actually on one web page there will be one button after clicking on that button i want to merge another web page inside  current one.
can you help me with that?

Thanking you






On Monday, April 29, 2019 at 11:03:35 PM UTC+5:30, Ahmed Ishtiaque wrote:
Hi Mayur, 

I'm not sure what you mean by "there is no javascript in django" because I use it all the time. JS is not tied to Django in any way since its operations are usually client-side and so it can be used inside your Django templates. 

In any case, you can have JS code in your template inside <script> tags, where you can asynchronously send a request to your relevant view using the Fetch API, then process the data and display it on your template.

Hope this helps! 

Best,
Ahmed

On Mon, Apr 29, 2019 at 1:03 PM Mayur Bagul <[hidden email]> wrote:
Hello Community,

Im looking for solution on Button Event.
I have situation like mention below :

i have one button check temperature. after clicking on it; it should display dummy temperature on template from view.py i wrote.  
but im not getting how i can do this because there is no javascript used in django.

Please guide me to get rid of this impedance.

Thanking you,
Mayur Bagul. 

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/3a9d8006-ab98-44e4-a2ce-66e4a439cd9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/6e236b20-0774-44ee-9012-1b036c1dd920%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAA%3Diw__fcZdAQ%3De_h0vUkyvAA2h5nuN5jVq0yNW0x8R7bEhf4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.