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

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

            Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

            Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?