Serverside validation select-fields


Topic: Serverside validation select-fields

gerdhuber pro premium asked 2 months ago

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

Actual behavior

Resources (screenshots, code snippets etc.)


Grzegorz Bujański staff answered 1 months ago

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


gerdhuber pro premium answered 1 months 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 1 months 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 premium answered 1 months ago

Thank you very much, it works fine.


Please insert min. 20 characters.
Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.9.0
  • Device: PC
  • Browser: all
  • OS: Windows
  • Provided sample code: No
  • Provided link: No