DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

character limit in a field

Sort:
You are not authorized to post a reply.





New Around Here





     

     

    Is it possible to limit characters in a given field? For example: Limit number of characters in a title or description

    In this case below, I want to limit the number of characters in the "description" field so that the text does not go outside the card.
    
    Is there this possibility in DNN?

      

     

     

    in "Fields" I can only edit the input type... would it be in this part that I could limit it?






    Veteran Member





      The module your working with is not standard DNN but 2SXC. Great module and a lot of documentation on https://docs.2sxc.org/

      Not the direct answer to your question but maybe someone else can elaborate ;-) 

      Tjep's digital agencyRegards,
      Tycho de Waard

      Tjep's digital agency
      We just love DNN
      https://www.tjeps.com





      Veteran Member





        When viewing your list of fields (modal under the one showing in your screenshot), click on the “Name” of the field (“descricao”) and you will see many ways to control the field behavior.

        David Poindexter


        Creator:







        Senior Member





          FYI, Marcos... I moved your post to a forum that better matches the conversation. 😉 






          Advanced Member





            There may be an easier way, but one option is using a regex to validate the field that would only accept x number of characters.

            Something like: ^.{0,100}$
            Which means
            ^ starts with
            . Any character
            {0,100} zero to a hundred times
            $ ends






            Veteran Member





              To help a bit with what Daniel Valadas mentions, you can find this in the Field Validations section in the field configuration view.  I was going to post a screenshot here but had an error.

              David Poindexter


              Creator:







              New Around Here





                Thank you all!!
                They can limit the characters using regex to validate the fields with the mentioned formula.

                ^.{0,100}$





                Veteran Member





                  Awesome, glad you got it working!

                  David Poindexter


                  Creator:







                  Advanced Member





                    Awesome Marcos! Thank you for sharing the regex code

                    Ing. Marco Alvarado Gómez MSc | Globalode
                    Phone. +506 6049-1880 | WhatsApp. +506 6049-1880 | Email. [email protected]
                    Address. Costa Rica (A Pura Vida place!).
                    You are not authorized to post a reply.

                    These Forums are dedicated to the discussion of DNN Platform.

                    For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

                    1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
                    2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
                    3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
                    4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
                    5. No Flaming or Trolling.
                    6. No Profanity, Racism, or Prejudice.
                    7. Site Moderators have the final word on approving / removing a thread or post or comment.
                    8. English language posting only, please.

                    Would you like to help us?

                    Awesome! Simply post in the forums using the link below and we'll get you started.

                    Get Involved