Dac Thach Nguyen
Feb 20, 2019
  5328
(8 votes)

Custom validation message for Forms

In Forms 4.23 we have released a feature that allows user can enter a custom validation message for each validator. Let say that you have some forms which used the same some validators (ex: RequiredValidator). When visitor enter something not correct, by default the form will display message stored in xml lang files. And there's no way to custom that message for different elements in different forms. But now it is easily done by editor.

First go to edit the field and enter the message on textbox next to it:

Publish the element, form and go to view mode to see the result:

That is, it's simple, right?

Feb 20, 2019

Comments

Praful Jangid
Praful Jangid Feb 21, 2019 06:33 AM

Nice feature.

Are we going to need something (just like we use @Html.ValidationMessage) to render this message?

Dac Thach Nguyen
Dac Thach Nguyen Feb 27, 2019 06:55 AM

No, the message come along with the validator and display using js. You don't need to modify template to have that feature.

Please login to comment.
Latest blogs
Commerce 14.45.0 is incompatible with CMS 12.34.2 (but that's an easy fix!)

Incompatible is a strong word, but that is to get your attention. This is one of the small thing that can be overlooked, but if you run into it, it...

Quan Mai | Mar 5, 2026

Announcing Stott Security Version 5.0

March 2026 marks the release of Stott Security v5, a significant update to the popular web security add-on for Optimizely CMS 12+, with more than...

Mark Stott | Mar 5, 2026

Optimizely CMS SaaS Migration Tool

Introduction Migrating and synchronizing environments in Optimizely CMS SaaS can be challenging, especially when working with multiple environments...

Hieu Nguyen | Mar 4, 2026

Alloy Aspire Scaffold, or how to simulate the Optimizely DXP setup on your dev machine

Alloy Aspire Scaffold is a .NET template for Optimizely CMS 13 PaaS (Preview) that runs the standard Alloy site on .NET Aspire 13 in a DXP-like loc...

Enes Bajramovic | Mar 4, 2026 |