Skip to content

Commit

Permalink
WIP(example): remove unused JS script
Browse files Browse the repository at this point in the history
  • Loading branch information
sultanmyrza committed Nov 10, 2023
1 parent 4f44cd0 commit 1e46da2
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions examples/capture-eye-html-design.html
Original file line number Diff line number Diff line change
Expand Up @@ -398,41 +398,6 @@ <h1>Details</h1>
body.addEventListener('transitionend', updateIcon);
}

/**
* Listens for the DOMContentLoaded event to initialize the form and its event listeners.
*/
document.addEventListener('DOMContentLoaded', (event) => {
// hideCaptureEyeModal();

const form = document.getElementById('nidForm');
const submitButton = form.querySelector('button[type="submit"]');

form.addEventListener('submit', async function (e) {
e.preventDefault(); // Prevent the default form submit action

const nid = form.nid.value;
const userToken = form.userToken.value;

// Disable the button and change the text
submitButton.disabled = true;
submitButton.textContent = 'Fetching...';

hideCaptureEyeModal();

// Call the fetchNID function here
try {
await fetchNID(nid, userToken);
} catch (error) {
console.error('Error fetching NID:', error);
// Handle any errors here
}

// Re-enable the button and reset the text
submitButton.disabled = false;
submitButton.textContent = 'Submit';
});
});

/**
* Updates the UI with the fetched data.
* @param {Object} data - The data object received from the fetch operation.
Expand Down

0 comments on commit 1e46da2

Please sign in to comment.