VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-validation-server-side/

⇱ Bootstrap 5 Validation Server side - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Validation Server side

Last Updated : 30 Nov, 2022

Bootstrap 5 Validation Server side provides valuable, actionable feedback to your users by browser default behaviors or custom styles and JavaScript. If you are using server-side validation, you can indicate invalid and valid form fields with .is-invalid and .is-valid and add .invalid-feedback & .valid-feedback with these classes it is a supported class.

Bootstrap 5 Validation server-side classes:

  • is-valid: This class is used to create a valid color input field.
  • is-invalid: This class is used to create an invalid color input field.
  • invalid-feedback: This class is used to give invalid color text feedback.
  • valid-feedback: This class is used to give valid color text feedback.

Syntax:

<section>
 <input type=" " class="Validation server-side Class"required>
 <section class="Validation server-side Class">
 .........
 </section>
</section>

Example 1: In this example we will create two input fields with two feedback sections and all of them will be set as invalid.

Output:

👁 Image
 

Example 2: In this example we will put one input field, which will be valid and others will be invalid

Output:

👁 Image

Reference: https://getbootstrap.com/docs/5.0/forms/validation/#server-side

Comment

Explore