Limit customer firstname and lastname in m2How to override .phtml files in Magento 2Added last name and search functionality in Customer GridWhy Magento ask First Name and Last Name?How to remove firstname, lastname validation (magento 1.9)How to post customer firstname & lastname into database magento 2.1.1?Magento 2 -Limit the length of the product name on the front end.Magento 2 Catch customer creation event on both frontend and adminMagento 2. Duplicate firstname, lastname, email inputs on customer account create frontendonly alphabet in firstname and lastname in customer registration form Magento 2How to show customer first name and last name after logged in Magento2.2.5?Spam account registrations, limiting characters in database not working

MinionPro is erroneous

Different inverter (logic gate) symbols

In a topological space if there exists a loop that cannot be contracted to a point does there exist a simple loop that cannot be contracted also?

Why does Intel's Haswell chip allow FP multiplication to be twice as fast as addition?

changing number of arguments to a function in secondary evaluation

Was the 2019 Lion King film made through motion capture?

Christian apologetics regarding the killing of innocent children during the Genesis flood

Write an interpreter for *

What happen to those who died but not from the snap?

Extremely casual way to make requests to very close friends

Blocking people from taking pictures of me with smartphone

How do I differentiate when a child LWC component is called twice in the parent component?

Does a code snippet compile? Or does it get compiled?

Infeasibility in mathematical optimization models

If "more guns less crime", how do gun advocates explain that the EU has less crime than the US?

The cat ate your input again!

Who are these characters/superheroes in the posters from Chris's room in Family Guy?

During the Space Shuttle Columbia Disaster of 2003, Why Did The Flight Director Say, "Lock the doors."?

Can a fight scene, component-wise, be too complex and complicated?

As a 16 year old, how can I keep my money safe from my mother?

(11 of 11: Meta) What is Pyramid Cult's All-Time Favorite?

What does this double-treble double-bass staff mean?

What are the conventions for transcribing Semitic languages into Greek?

Help evaluating integral (anything simple that I am missing?)



Limit customer firstname and lastname in m2


How to override .phtml files in Magento 2Added last name and search functionality in Customer GridWhy Magento ask First Name and Last Name?How to remove firstname, lastname validation (magento 1.9)How to post customer firstname & lastname into database magento 2.1.1?Magento 2 -Limit the length of the product name on the front end.Magento 2 Catch customer creation event on both frontend and adminMagento 2. Duplicate firstname, lastname, email inputs on customer account create frontendonly alphabet in firstname and lastname in customer registration form Magento 2How to show customer first name and last name after logged in Magento2.2.5?Spam account registrations, limiting characters in database not working






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















How can we limit the character of first name and last name of customer. For example I want only 30 characters are valid to enter in first & last name. As of now there is no limit on character we can add as many character we want.



Looking for advices
Thanks










share|improve this question
























  • do you want to limit 30 character individually for first name and last name OR in combined name (first name + last name) ?

    – Shashank Kumrawat
    Oct 12 '18 at 13:14












  • yes individually

    – Daniel_12
    Oct 12 '18 at 13:14











  • for individual , you can use maxlength property of text field of first name and last name like this link

    – Shashank Kumrawat
    Oct 12 '18 at 13:16











  • no but how can we do this in magento 2. I am aware of maxlength="10" feature

    – Daniel_12
    Oct 12 '18 at 13:17











  • you need to override template file vendor/magento/module-customer/view/frontend/templates/widget/name.phtml and need to put maxlength property there.

    – Shashank Kumrawat
    Oct 12 '18 at 13:23

















1















How can we limit the character of first name and last name of customer. For example I want only 30 characters are valid to enter in first & last name. As of now there is no limit on character we can add as many character we want.



Looking for advices
Thanks










share|improve this question
























  • do you want to limit 30 character individually for first name and last name OR in combined name (first name + last name) ?

    – Shashank Kumrawat
    Oct 12 '18 at 13:14












  • yes individually

    – Daniel_12
    Oct 12 '18 at 13:14











  • for individual , you can use maxlength property of text field of first name and last name like this link

    – Shashank Kumrawat
    Oct 12 '18 at 13:16











  • no but how can we do this in magento 2. I am aware of maxlength="10" feature

    – Daniel_12
    Oct 12 '18 at 13:17











  • you need to override template file vendor/magento/module-customer/view/frontend/templates/widget/name.phtml and need to put maxlength property there.

    – Shashank Kumrawat
    Oct 12 '18 at 13:23













1












1








1








How can we limit the character of first name and last name of customer. For example I want only 30 characters are valid to enter in first & last name. As of now there is no limit on character we can add as many character we want.



Looking for advices
Thanks










share|improve this question














How can we limit the character of first name and last name of customer. For example I want only 30 characters are valid to enter in first & last name. As of now there is no limit on character we can add as many character we want.



Looking for advices
Thanks







magento2 customer customer-account magento2-enterprise name






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 12 '18 at 13:06









Daniel_12Daniel_12

3201 silver badge12 bronze badges




3201 silver badge12 bronze badges















  • do you want to limit 30 character individually for first name and last name OR in combined name (first name + last name) ?

    – Shashank Kumrawat
    Oct 12 '18 at 13:14












  • yes individually

    – Daniel_12
    Oct 12 '18 at 13:14











  • for individual , you can use maxlength property of text field of first name and last name like this link

    – Shashank Kumrawat
    Oct 12 '18 at 13:16











  • no but how can we do this in magento 2. I am aware of maxlength="10" feature

    – Daniel_12
    Oct 12 '18 at 13:17











  • you need to override template file vendor/magento/module-customer/view/frontend/templates/widget/name.phtml and need to put maxlength property there.

    – Shashank Kumrawat
    Oct 12 '18 at 13:23

















  • do you want to limit 30 character individually for first name and last name OR in combined name (first name + last name) ?

    – Shashank Kumrawat
    Oct 12 '18 at 13:14












  • yes individually

    – Daniel_12
    Oct 12 '18 at 13:14











  • for individual , you can use maxlength property of text field of first name and last name like this link

    – Shashank Kumrawat
    Oct 12 '18 at 13:16











  • no but how can we do this in magento 2. I am aware of maxlength="10" feature

    – Daniel_12
    Oct 12 '18 at 13:17











  • you need to override template file vendor/magento/module-customer/view/frontend/templates/widget/name.phtml and need to put maxlength property there.

    – Shashank Kumrawat
    Oct 12 '18 at 13:23
















do you want to limit 30 character individually for first name and last name OR in combined name (first name + last name) ?

– Shashank Kumrawat
Oct 12 '18 at 13:14






do you want to limit 30 character individually for first name and last name OR in combined name (first name + last name) ?

– Shashank Kumrawat
Oct 12 '18 at 13:14














yes individually

– Daniel_12
Oct 12 '18 at 13:14





yes individually

– Daniel_12
Oct 12 '18 at 13:14













for individual , you can use maxlength property of text field of first name and last name like this link

– Shashank Kumrawat
Oct 12 '18 at 13:16





for individual , you can use maxlength property of text field of first name and last name like this link

– Shashank Kumrawat
Oct 12 '18 at 13:16













no but how can we do this in magento 2. I am aware of maxlength="10" feature

– Daniel_12
Oct 12 '18 at 13:17





no but how can we do this in magento 2. I am aware of maxlength="10" feature

– Daniel_12
Oct 12 '18 at 13:17













you need to override template file vendor/magento/module-customer/view/frontend/templates/widget/name.phtml and need to put maxlength property there.

– Shashank Kumrawat
Oct 12 '18 at 13:23





you need to override template file vendor/magento/module-customer/view/frontend/templates/widget/name.phtml and need to put maxlength property there.

– Shashank Kumrawat
Oct 12 '18 at 13:23










2 Answers
2






active

oldest

votes


















0














Try This Code



<input type="text" name="first name" id="first_name"
class="admin__control-text required-entry validate-alphanum-with-spaces validate-length maximum-length-30"
maxlength="30" />


whatever you want set input field length,set in maxlength attribute






share|improve this answer
































    0














    You need to override core template file vendor/magento/module-customer/view/frontend/templates/widget/name.phtml in your theme folder using this link -




    How to override .phtml files in Magento 2




    and need to put maxlength property in input text field of first name and last name as suggested here.




    https://www.w3schools.com/tags/att_input_maxlength.asp




    hope this helps.






    share|improve this answer

























    • rakeshjesadiya.com/…

      – Rakesh Jesadiya
      Mar 5 at 8:13













    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f246292%2flimit-customer-firstname-and-lastname-in-m2%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Try This Code



    <input type="text" name="first name" id="first_name"
    class="admin__control-text required-entry validate-alphanum-with-spaces validate-length maximum-length-30"
    maxlength="30" />


    whatever you want set input field length,set in maxlength attribute






    share|improve this answer





























      0














      Try This Code



      <input type="text" name="first name" id="first_name"
      class="admin__control-text required-entry validate-alphanum-with-spaces validate-length maximum-length-30"
      maxlength="30" />


      whatever you want set input field length,set in maxlength attribute






      share|improve this answer



























        0












        0








        0







        Try This Code



        <input type="text" name="first name" id="first_name"
        class="admin__control-text required-entry validate-alphanum-with-spaces validate-length maximum-length-30"
        maxlength="30" />


        whatever you want set input field length,set in maxlength attribute






        share|improve this answer













        Try This Code



        <input type="text" name="first name" id="first_name"
        class="admin__control-text required-entry validate-alphanum-with-spaces validate-length maximum-length-30"
        maxlength="30" />


        whatever you want set input field length,set in maxlength attribute







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 12 '18 at 13:21









        Balwant SinghBalwant Singh

        4341 gold badge3 silver badges16 bronze badges




        4341 gold badge3 silver badges16 bronze badges


























            0














            You need to override core template file vendor/magento/module-customer/view/frontend/templates/widget/name.phtml in your theme folder using this link -




            How to override .phtml files in Magento 2




            and need to put maxlength property in input text field of first name and last name as suggested here.




            https://www.w3schools.com/tags/att_input_maxlength.asp




            hope this helps.






            share|improve this answer

























            • rakeshjesadiya.com/…

              – Rakesh Jesadiya
              Mar 5 at 8:13















            0














            You need to override core template file vendor/magento/module-customer/view/frontend/templates/widget/name.phtml in your theme folder using this link -




            How to override .phtml files in Magento 2




            and need to put maxlength property in input text field of first name and last name as suggested here.




            https://www.w3schools.com/tags/att_input_maxlength.asp




            hope this helps.






            share|improve this answer

























            • rakeshjesadiya.com/…

              – Rakesh Jesadiya
              Mar 5 at 8:13













            0












            0








            0







            You need to override core template file vendor/magento/module-customer/view/frontend/templates/widget/name.phtml in your theme folder using this link -




            How to override .phtml files in Magento 2




            and need to put maxlength property in input text field of first name and last name as suggested here.




            https://www.w3schools.com/tags/att_input_maxlength.asp




            hope this helps.






            share|improve this answer













            You need to override core template file vendor/magento/module-customer/view/frontend/templates/widget/name.phtml in your theme folder using this link -




            How to override .phtml files in Magento 2




            and need to put maxlength property in input text field of first name and last name as suggested here.




            https://www.w3schools.com/tags/att_input_maxlength.asp




            hope this helps.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Oct 12 '18 at 13:45









            Shashank KumrawatShashank Kumrawat

            1,35813 silver badges47 bronze badges




            1,35813 silver badges47 bronze badges















            • rakeshjesadiya.com/…

              – Rakesh Jesadiya
              Mar 5 at 8:13

















            • rakeshjesadiya.com/…

              – Rakesh Jesadiya
              Mar 5 at 8:13
















            rakeshjesadiya.com/…

            – Rakesh Jesadiya
            Mar 5 at 8:13





            rakeshjesadiya.com/…

            – Rakesh Jesadiya
            Mar 5 at 8:13

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f246292%2flimit-customer-firstname-and-lastname-in-m2%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form