Skip to content

Commit

Permalink
fixed textbox
Browse files Browse the repository at this point in the history
  • Loading branch information
DDDrag0 committed Jan 20, 2024
1 parent d37859a commit 8ea0e44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
13 changes: 4 additions & 9 deletions src/main/webapp/JS/login.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const resetEmail = $("#resetEmail");
const c1 = $("#c1");
const c2 = $("#c2");
const c3 = $("#c3");
const c4 = $('#c4');
const loginPage = $('#loginPage');
const pin = $("#pin");
const resetEmail = $("#resetEmail");
const container = $('#container');
const newPassword = $("#newPassword");
const repeatNewPassword = $("#repeatNewPassword");
Expand Down Expand Up @@ -150,18 +151,12 @@ $(document).ready(function startUp() {

$("#confirmPin").click((event) => {
event.preventDefault();
let data = '';
for (let i = 0; i < 4; i++) {
let squareId = 'square' + i;
let square = document.getElementById(squareId);
data += square.textContent || '0';
}
if (data === sessionPin) {
if (pin.val() === sessionPin) {
// if the PIN entered matches the saved PIN, proceed to step 3
c2.hide();
c3.show();
} else {
alert('The pin is incorrect');
alert('Il pin non è corretto');
}
});

Expand Down
7 changes: 1 addition & 6 deletions src/main/webapp/JSP/login.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,7 @@
<div class="discovering-english">Inserisci Codice di Verifica</div>
<p class="chapter"> Se hai fornito l’email correttamente, Inserisci <br>
il codice di verifica che ti abbiamo inviato.</p>
<div class="cardo">
<div class="square" onclick="focusInput(0)" id="square0"></div>
<div class="square" onclick="focusInput(1)" id="square1"></div>
<div class="square" onclick="focusInput(2)" id="square2"></div>
<div class="square" onclick="focusInput(3)" id="square3"></div>
</div>
<input class="box" placeholder="pin" id="pin" pattern="^\d{4}$" type="email">
<p class="chapter">Non hai ricevuto il codice?Rimanda</p>
<button class="button" id="confirmPin">Conferma</button>
</div>
Expand Down

0 comments on commit 8ea0e44

Please sign in to comment.