How to make a Field only accept Numbers in Magento 2 Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How to add field dependency in admin customer form UI componentMagento 2 - How to add the DateTime UI ComponentHow to make a form field readonly using ui-components?Checkout uiComponent (input field) rendered multiple times: how do I apply viewmodel functionality to current input field only?Magento 2 UI Component field customize based on conditionMagento 2: How to add color picker in ui formMagento 2: How to use IMG upload field UIComponent?Read only field in UI component form Magento 2Disabling a UI component field while add new product in Magento 2Magento 2 checkout postcode validation only numbers

Is CEO the "profession" with the most psychopaths?

What does it mean that physics no longer uses mechanical models to describe phenomena?

Why do early math courses focus on the cross sections of a cone and not on other 3D objects?

How could we fake a moon landing now?

What is the meaning of 'breadth' in breadth first search?

What order were files/directories outputted in dir?

How would a mousetrap for use in space work?

Is this another way of expressing the side limit?

When a candle burns, why does the top of wick glow if bottom of flame is hottest?

Is there hard evidence that the grant peer review system performs significantly better than random?

Converted a Scalar function to a TVF function for parallel execution-Still running in Serial mode

"Lost his faith in humanity in the trenches of Verdun" — last line of an SF story

Did Mueller's report provide an evidentiary basis for the claim of Russian govt election interference via social media?

Most bit efficient text communication method?

What's the meaning of "fortified infraction restraint"?

What was the first language to use conditional keywords?

What is this clumpy 20-30cm high yellow-flowered plant?

An adverb for when you're not exaggerating

difference in test statistic and p-value R and Python script

Should there be a hyphen in the construction "IT affin"?

Significance of Cersei's obsession with elephants?

Selecting user stories during sprint planning

One-one communication

Time to Settle Down!



How to make a Field only accept Numbers in Magento 2



Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?How to add field dependency in admin customer form UI componentMagento 2 - How to add the DateTime UI ComponentHow to make a form field readonly using ui-components?Checkout uiComponent (input field) rendered multiple times: how do I apply viewmodel functionality to current input field only?Magento 2 UI Component field customize based on conditionMagento 2: How to add color picker in ui formMagento 2: How to use IMG upload field UIComponent?Read only field in UI component form Magento 2Disabling a UI component field while add new product in Magento 2Magento 2 checkout postcode validation only numbers



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








1















I am new to Magento 2.



I am trying to make a field that can only accept numbers for Sort Order field on UI Component Form



I need help










share|improve this question









New contributor




Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


























    1















    I am new to Magento 2.



    I am trying to make a field that can only accept numbers for Sort Order field on UI Component Form



    I need help










    share|improve this question









    New contributor




    Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      1












      1








      1








      I am new to Magento 2.



      I am trying to make a field that can only accept numbers for Sort Order field on UI Component Form



      I need help










      share|improve this question









      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I am new to Magento 2.



      I am trying to make a field that can only accept numbers for Sort Order field on UI Component Form



      I need help







      magento2 php uicomponent field






      share|improve this question









      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 59 mins ago









      ARUNPRABAKARAN M

      492113




      492113






      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 hour ago









      Waqar AliWaqar Ali

      186




      186




      New contributor




      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Waqar Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          3 Answers
          3






          active

          oldest

          votes


















          2














          you just need to add



          <item name="validate-number" xsi:type="boolean">true</item>


          in your specific field in ui_component






          share|improve this answer























          • Thank you if i need max_lenght and min_length.. how can i achive this

            – Waqar Ali
            52 mins ago











          • max_length of what?

            – Asad Khan
            52 mins ago











          • first try this code it will only accept the numbers

            – Asad Khan
            51 mins ago











          • i have done that and its working perfectly.. thank you

            – Waqar Ali
            50 mins ago











          • i want to limit user to user numebrs between 10 and -10

            – Waqar Ali
            50 mins ago


















          0














          Hope it's helps



          <item name="validate-number" xsi:type="boolean">true</item>
          <item name="max_text_length" xsi:type="number">50</item>





          share|improve this answer






























            0














            Just want to add this one, if you want to validate user input if it is within the range of -10 to 10.



            <item name="validation" xsi:type="array">
            <item name="validate-digits" xsi:type="boolean">true</item>
            <item name="validate-digits-range" xsi:type="string">-10-10</item>
            </item>


            Note: use validate digits instead of validate number when you are validating integers otherwise use number when you are validating number input with decimals.






            share|improve this answer























              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
              );



              );






              Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.









              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270780%2fhow-to-make-a-field-only-accept-numbers-in-magento-2%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              2














              you just need to add



              <item name="validate-number" xsi:type="boolean">true</item>


              in your specific field in ui_component






              share|improve this answer























              • Thank you if i need max_lenght and min_length.. how can i achive this

                – Waqar Ali
                52 mins ago











              • max_length of what?

                – Asad Khan
                52 mins ago











              • first try this code it will only accept the numbers

                – Asad Khan
                51 mins ago











              • i have done that and its working perfectly.. thank you

                – Waqar Ali
                50 mins ago











              • i want to limit user to user numebrs between 10 and -10

                – Waqar Ali
                50 mins ago















              2














              you just need to add



              <item name="validate-number" xsi:type="boolean">true</item>


              in your specific field in ui_component






              share|improve this answer























              • Thank you if i need max_lenght and min_length.. how can i achive this

                – Waqar Ali
                52 mins ago











              • max_length of what?

                – Asad Khan
                52 mins ago











              • first try this code it will only accept the numbers

                – Asad Khan
                51 mins ago











              • i have done that and its working perfectly.. thank you

                – Waqar Ali
                50 mins ago











              • i want to limit user to user numebrs between 10 and -10

                – Waqar Ali
                50 mins ago













              2












              2








              2







              you just need to add



              <item name="validate-number" xsi:type="boolean">true</item>


              in your specific field in ui_component






              share|improve this answer













              you just need to add



              <item name="validate-number" xsi:type="boolean">true</item>


              in your specific field in ui_component







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered 53 mins ago









              Asad KhanAsad Khan

              38310




              38310












              • Thank you if i need max_lenght and min_length.. how can i achive this

                – Waqar Ali
                52 mins ago











              • max_length of what?

                – Asad Khan
                52 mins ago











              • first try this code it will only accept the numbers

                – Asad Khan
                51 mins ago











              • i have done that and its working perfectly.. thank you

                – Waqar Ali
                50 mins ago











              • i want to limit user to user numebrs between 10 and -10

                – Waqar Ali
                50 mins ago

















              • Thank you if i need max_lenght and min_length.. how can i achive this

                – Waqar Ali
                52 mins ago











              • max_length of what?

                – Asad Khan
                52 mins ago











              • first try this code it will only accept the numbers

                – Asad Khan
                51 mins ago











              • i have done that and its working perfectly.. thank you

                – Waqar Ali
                50 mins ago











              • i want to limit user to user numebrs between 10 and -10

                – Waqar Ali
                50 mins ago
















              Thank you if i need max_lenght and min_length.. how can i achive this

              – Waqar Ali
              52 mins ago





              Thank you if i need max_lenght and min_length.. how can i achive this

              – Waqar Ali
              52 mins ago













              max_length of what?

              – Asad Khan
              52 mins ago





              max_length of what?

              – Asad Khan
              52 mins ago













              first try this code it will only accept the numbers

              – Asad Khan
              51 mins ago





              first try this code it will only accept the numbers

              – Asad Khan
              51 mins ago













              i have done that and its working perfectly.. thank you

              – Waqar Ali
              50 mins ago





              i have done that and its working perfectly.. thank you

              – Waqar Ali
              50 mins ago













              i want to limit user to user numebrs between 10 and -10

              – Waqar Ali
              50 mins ago





              i want to limit user to user numebrs between 10 and -10

              – Waqar Ali
              50 mins ago













              0














              Hope it's helps



              <item name="validate-number" xsi:type="boolean">true</item>
              <item name="max_text_length" xsi:type="number">50</item>





              share|improve this answer



























                0














                Hope it's helps



                <item name="validate-number" xsi:type="boolean">true</item>
                <item name="max_text_length" xsi:type="number">50</item>





                share|improve this answer

























                  0












                  0








                  0







                  Hope it's helps



                  <item name="validate-number" xsi:type="boolean">true</item>
                  <item name="max_text_length" xsi:type="number">50</item>





                  share|improve this answer













                  Hope it's helps



                  <item name="validate-number" xsi:type="boolean">true</item>
                  <item name="max_text_length" xsi:type="number">50</item>






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 33 mins ago









                  ARUNPRABAKARAN MARUNPRABAKARAN M

                  492113




                  492113





















                      0














                      Just want to add this one, if you want to validate user input if it is within the range of -10 to 10.



                      <item name="validation" xsi:type="array">
                      <item name="validate-digits" xsi:type="boolean">true</item>
                      <item name="validate-digits-range" xsi:type="string">-10-10</item>
                      </item>


                      Note: use validate digits instead of validate number when you are validating integers otherwise use number when you are validating number input with decimals.






                      share|improve this answer



























                        0














                        Just want to add this one, if you want to validate user input if it is within the range of -10 to 10.



                        <item name="validation" xsi:type="array">
                        <item name="validate-digits" xsi:type="boolean">true</item>
                        <item name="validate-digits-range" xsi:type="string">-10-10</item>
                        </item>


                        Note: use validate digits instead of validate number when you are validating integers otherwise use number when you are validating number input with decimals.






                        share|improve this answer

























                          0












                          0








                          0







                          Just want to add this one, if you want to validate user input if it is within the range of -10 to 10.



                          <item name="validation" xsi:type="array">
                          <item name="validate-digits" xsi:type="boolean">true</item>
                          <item name="validate-digits-range" xsi:type="string">-10-10</item>
                          </item>


                          Note: use validate digits instead of validate number when you are validating integers otherwise use number when you are validating number input with decimals.






                          share|improve this answer













                          Just want to add this one, if you want to validate user input if it is within the range of -10 to 10.



                          <item name="validation" xsi:type="array">
                          <item name="validate-digits" xsi:type="boolean">true</item>
                          <item name="validate-digits-range" xsi:type="string">-10-10</item>
                          </item>


                          Note: use validate digits instead of validate number when you are validating integers otherwise use number when you are validating number input with decimals.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 13 mins ago









                          magefmsmagefms

                          2,7702528




                          2,7702528




















                              Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.









                              draft saved

                              draft discarded


















                              Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.












                              Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.











                              Waqar Ali is a new contributor. Be nice, and check out our Code of Conduct.














                              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%2f270780%2fhow-to-make-a-field-only-accept-numbers-in-magento-2%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

                              Isurus Índice Especies | Notas | Véxase tamén | Menú de navegación"A compendium of fossil marine animal genera (Chondrichthyes entry)"o orixinal"A review of the Tertiary fossil Cetacea (Mammalia) localities in wales port taf Museum Victoria"o orixinalThe Vertebrate Fauna of the Selma Formation of Alabama. Part VII. Part VIII. The Mosasaurs The Fishes50419737IDsh85068767Isurus2548834613242066569678159923NHMSYS00210535017845105743

                              Король Коль Исторические данные | Стихотворение | Примечания | Навигацияверсии1 правкаверсии1 правкаA New interpretation of the 'Artognou' stone, TintagelTintagel IslandАрхивировано

                              Roughly how much would it cost to hire a team of dwarves to build a home in the mountainside? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How much does a house cost?How long does it take to mine rock?How much does a house cost?How much gold would the construction of a forge cost?How much does a door cost?How much would it cost to make this magic item?How much would a glue bomb cost?How much does mandrake root cost?How much does a slave cost?How much does equipment cost?How much do sheep cost?How much would firearms cost?