Hi Shadib, it looks good. I have some suggestions to your code:
- Add labels to the input, you can hide them with something like bootstraps
.sr-only
class
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0 0 0 0);
border: 0;
}
- Use a real button, instead of
div role="button"
you could usebutton type="submit"
0
Shadib Shah• 610
@shadib0797
Posted
@MisterEdel that's what i want to know why my JS validation changes does not persist when using button type="submit" or any other, they show up like for 1 sec and then disappears.
0
@shadib0797 you could use preventDefault
on the click event to stop the submission if there are errors. See here: https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault
0