How to limit a "Spare Field" field to a maximum of 18 characters in a service item parameter on the web portal?

Hi everyone,
I'm configuring a service item on the web portal and I need to limit the "Nome de exibição da conta" (or a spare field) to accept a maximum of 18 characters. Is there a way to enforce this restriction, either through configuration, scripting, validation rules or in WebDesigner?

Any help or guidance would be appreciated.
Thanks in advance!