Skip to content

Commit

Permalink
api-sample - Allow submit during validation
Browse files Browse the repository at this point in the history
  • Loading branch information
EJMFarrow committed Jan 10, 2025
1 parent 2a5a5c8 commit ac6ad5e
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions api/public/stackshared.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ function send() {

// Validate an input. Called a set amount of time after an input is last updated.
function validate(element) {
loading(true);
const http = new XMLHttpRequest();
const url = window.location.origin + '/validate';
http.open("POST", url, true);
Expand All @@ -189,7 +188,6 @@ function validate(element) {
http.onreadystatechange = function () {
if (http.readyState == 4) {
try {
loading(false);
const json = JSON.parse(http.responseText);
if (json.message) {
document.getElementById('errors').innerText = json.message;
Expand All @@ -211,7 +209,6 @@ function validate(element) {
}
catch (e) {
document.getElementById('errors').innerText = http.responseText;
loading(false);
return;
}
}
Expand Down

0 comments on commit ac6ad5e

Please sign in to comment.