Suggestions on constraining input field length

This is a two-part question.

  1. What is the best way to implement a maxlength on a text input field? Check On Change for the length comes to mind but it would be nice if there was a simple way that doesn’t require coding for an HTML attribute.

  2. Is it best practice to validate all input lengths before inserting them into the database as a double check to make sure they’re not longer than the max length of the column?


Hi @Tim_Jones

  1. You can create a Cloud Code handler, such as “before create,” and add a simple check for the input length before saving data to the database. This approach allows you to enforce the character limit without modifying HTML attributes directly.

  2. Yes, it’s considered a best practice to validate input lengths before inserting them into the database. Adding a length validator serves as an essential double-check to ensure data integrity.


Thanks @Viktor_Mudrevsky

For 1) that seems like a lot of work relative to setting maxlength=“20”. I’m surprised it is not a setting of the input -

Hello @Tim_Jones!

Thank you for the suggestion!
I’ve created a ticket for the implementation of this feature.
We’ll keep you updated on this topic once it’s ready.


Thank you!