mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-24 08:25:17 -06:00
Add javascript to disable empty form fields
This commit is contained in:
parent
2e5a5f71ba
commit
3948fcf08e
@ -1,7 +1,21 @@
|
||||
{% load form_helpers %}
|
||||
{% load helpers %}
|
||||
|
||||
<form action="." method="get">
|
||||
<script>
|
||||
function cleangeturl(form) {
|
||||
|
||||
var form_elements = form.elements;
|
||||
|
||||
for (var i=0; i<form_elements.length; i++ ) {
|
||||
var element = form_elements[i]
|
||||
if (element.name && element.value == '') {
|
||||
element.disabled=true;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<form action="." method="get" onsubmit="return cleangeturl(this)">
|
||||
<div class="card">
|
||||
<div class="card-body overflow-visible d-flex flex-wrap justify-content-between py-3">
|
||||
{% for field in filter_form.hidden_fields %}
|
||||
|
Loading…
Reference in New Issue
Block a user