7.37. Bootstrap5 form validation

发布时间 : 2025-10-25 13:35:28 UTC      

Page Views: 26 views

We can use different validation classes to set up the validation function of the form.

.was-validated or .needs-validation add to

element, the input input field will have a green (valid) or red (invalid) border effect to indicate whether the form requires input.

.valid-feedback or .invalid-feedback class is used to tell the user what information is missing or what needs to be done before submitting the form.

7.37.1. Example

Use .was-validated class displays what the form needs to fill in beforeit is submitted:


  
Verification successful!
Please enter your username!
Verification successful!
Please enter password!

7.37.2. Example

Use .needs-validation which validates the missing content after the form is submitted You need to add some JavaScript code here to make the codework:

Verification successful!
enter one user name!
Verification successful!
Please enter password!

Principles, Technologies, and Methods of Geographic Information Systems

 102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.