开发者

Disable javascript for a form in django

开发者 https://www.devze.com 2023-03-27 11:42 出处:网络
I have the following form element in my django template: {{form.graduation }} which gives me a select dropdown with a range of years.

I have the following form element in my django template:

{{form.graduation }}

which gives me a select dropdown with a range of years.

However, I have a generic external javascript document that affects select dropdowns. I can disable the rendering of dropdowns on the page by disabling the js sheet, but there are a couple of select dropdowns on the page that need the js to render properly. Is there a way开发者_StackOverflow中文版 to disable the js for a particular tag within the django template (without changing the external javascript sheet?).

Conceptually, it'd be something like:

{% disable js-rendering %} <this element> ... </this element> {% end disable %}

Is there something that does this native to django? Thank you.

0

精彩评论

暂无评论...
验证码 换一张
取 消