show custom validation text instead of red frame

Hi, i put required on my text box and instead of red out the text box i would like to show a text message as well.
i tried this example but didnt work for me

$w.onReady( function () {
//TODO: write your page related code here…
$w(“#SellerName”).onCustomValidation( (value, reject) => {
if ( !value.length <1 ) {
reject(“Email address must be a wix.com address.”);
}
} );

Hi Siyamand Rashid.

I think your condition should be reversed.

 // instead of 
 if( !value.length <1 ) {
 
 // should be
 if(value.length < 1 ) { 

Or some more complex logic, like regular expression containing the string condition you require. See more about regular expressions in Javascript here: Regular expressions - JavaScript | MDN

Regards,
Genry.