Simplify front-end error-clearing logic.
This commit is contained in:
parent
5024a79842
commit
c7229d5db1
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
const clearErrors = () => {
|
const clearErrors = () => {
|
||||||
const e = document.getElementById('letter_errors')
|
const e = document.getElementById('letter_errors')
|
||||||
e.parentNode.removeChild(e)
|
e?.parentNode.removeChild(e)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{% endblock head %}
|
{% endblock head %}
|
||||||
|
@ -106,11 +106,7 @@
|
||||||
<a href="javascript:void(0)"
|
<a href="javascript:void(0)"
|
||||||
class="wipe up-wipe"
|
class="wipe up-wipe"
|
||||||
style="margin-bottom: 1em;"
|
style="margin-bottom: 1em;"
|
||||||
{% if letter_errors %}
|
onclick="clearErrors();document.getElementById('letter-form').submit()"
|
||||||
onclick="clearErrors();document.getElementById('letter-form').submit()"
|
|
||||||
{% else %}
|
|
||||||
onclick="document.getElementById('letter-form').submit()"
|
|
||||||
{% endif %}
|
|
||||||
>Generate PDF</a>
|
>Generate PDF</a>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in New Issue