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