I'm creating a grading system website, grades can be edited using the edit button however you need to enter a 4 digit password to be able to do so, how do i implement that .
CodePudding user response:
You could use the HTML password input field:
<form>
<input type="password" minlength="4" maxlength="4" placeholder="Enter password" required>
</form>
CodePudding user response:
you could do this in several ways
1- you can use javascript prompt pop up (it's similar to alert but it accepts a value 2- another solution is to have a hidden form and toggle it when you click the edit button 3- you can use modal that appears when you click the edit button
after the user enters the password, you can compare it with the password stored in your database
then you could change the span showing the grade to a form with submit button to enter the new value