Topic: Serverside validation select-fields

gerdhuber pro asked 3 years ago


Expected behavior i would like an example of how to check select-fields server-side.

Actual behavior

Resources (screenshots, code snippets etc.)


gerdhuber pro answered 3 years ago


Thank you very much, it works fine.


Grzegorz Bujański staff answered 3 years ago


This is because during validation on the front-end, the input gets the status valid. then additional input styling works:

.form-control:valid {
    margin-bottom: 1rem;
    background-image: none;
    border-color: #00b74a;
}

The most important here is the additional margin. To reflect this, the easiest way is to add a margin to the message with feedback. Just add mt-1 class

  <div id="a_FK_HHC_Bilder04" class="invalid-feedback mt-1 d-block">
    Abteilung leer, bitte eingeben!
  </div>

gerdhuber pro answered 3 years ago


I have made an example that works, but the error message should be a little lower, how does that work?

Please see snippet:

https://mdbootstrap.com/snippets/standard/gerdhuber/3303205


Grzegorz Bujański staff answered 3 years ago


Unfortunately we do not have such an example. You have to create such validation on your own.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 3.9.0
  • Device: PC
  • Browser: all
  • OS: Windows
  • Provided sample code: No
  • Provided link: No