@rehberbey
Posted
Looks great! 🎀
-
With HTML, you can already validate the form on the client side. You can use attributes like pattern and accept. I suggest you look at input attributes.
-
You can use the :invalid pseudo-class to change the style of the element when the wrong input is entered.
-
After that, it will be to submit the form to the server.
-
If you still want to authenticate with javascript on the client side, you can read this. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#client-side_validation
<form action="" method="post">
<label for="name">Name:</label>
<input type="text" name="name" id="name" required pattern="[a-zA-Z]+" placeholder="John" />
<input type="submit" />
</form>
input:invalid {
border: 2px solid red;
}
@TaskinSultana
Posted
@rehberbey Thank You So Much :)