function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ramesh k 29ramesh k 29 

text field should not accept more then 40 char

Hi,
i have one name text field it should not accept more than 40 char for that what logic i can follow
brahmaji tammanabrahmaji tammana
Try this:
<ui:inputText label="Name" maxlength="40" />

Thanks
Brahma
Ashish Agarwal 31Ashish Agarwal 31
Hi Ramesh,

You can create a Validation Rule on the field to which you want to restrict the number of characters.
 
LEN ( fieldName ) > 40

Use the above snippet in your validation rule.

Thanks 
Ashish
ramesh k 29ramesh k 29
hi,

i wrote a some validation my code is
if(/[^a-zA-Z0-9\-\/]/.test(oppName) || oppName.length>40)