Hello everyone, I'm seeking assistance with my code. Below is the form code I need help with:
<form action="input.php" method="POST">
<input type="text" class="input" name="firstname" placeholder="First Name" required>
<input type="text" class="input" name="lastname" placeholder="Last Name" required=""><br>
<input type="text" class="input lower" name="streetnumber" placeholder="Street / Number" required=""><br>
<input type="text" class="input lower" name="city" placeholder="City" required=""><br>
<input type="text" class="input lower" name="country" placeholder="Country" required=""><br>
<button type="submit">Add User</button>
</form>
I am trying to determine if using 'required' in the input fields can trigger validation. The type of validation I am looking for is essentially NOT NULL, and I would like a paragraph above each input field to display text ("This field is required"). If you are unsure about my question, please leave a comment and I will provide more information. I understand that I may need to use some JavaScript code, so any help with that code and guidance on what I need would be greatly appreciated.
Thank you to the community for your assistance.