refactor: js password validation to single file
This commit is contained in:
8
app/static/js/passwords-match.js
Normal file
8
app/static/js/passwords-match.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
(() => {
|
||||||
|
'use strict'
|
||||||
|
const password = document.getElementById("password");
|
||||||
|
const password_validation = document.getElementById("password-confirmation");
|
||||||
|
password.addEventListener('change', (c) => {
|
||||||
|
password_validation.setAttribute("pattern", c.target.value);
|
||||||
|
});
|
||||||
|
})()
|
||||||
@@ -97,14 +97,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script src="{{ url_for('static', filename='js/validate-form.js') }}"></script>
|
<script src="{{ url_for('static', filename='js/validate-form.js') }}"></script>
|
||||||
<script>
|
<script src="{{ url_for('static', filename='js/passwords-match.js') }}"></script>
|
||||||
(() => {
|
|
||||||
'use strict'
|
|
||||||
const password = document.getElementById("password");
|
|
||||||
const password_validation = document.getElementById("password-confirmation");
|
|
||||||
password.addEventListener('change', (c) => {
|
|
||||||
password_validation.setAttribute("pattern", c.target.value);
|
|
||||||
});
|
|
||||||
})()
|
|
||||||
</script>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user