How to make a Field only accept Numbers in Magento 2How 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

Why do games have consumables?

Function pointer with named arguments?

Get consecutive integer number ranges from list of int

Map of water taps to fill bottles

bldc motor, esc and battery draw, nominal vs peak

Elements other than carbon that can form many different compounds by bonding to themselves?

How did Captain America manage to do this?

Aligning equation numbers vertically

Why does Mind Blank stop the Feeblemind spell?

Why was the Spitfire's elliptical wing almost uncopied by other aircraft of World War 2?

How to stop co-workers from teasing me because I know Russian?

Who was the lone kid in the line of people at the lake at the end of Avengers: Endgame?

Is there any official lore on the Far Realm?

Initiative: Do I lose my attack/action if my target moves or dies before my turn in combat?

"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?

Contradiction proof for inequality of P and NP?

Can someone publish a story that happened to you?

Like totally amazing interchangeable sister outfits II: The Revenge

Why does nature favour the Laplacian?

How can I practically buy stocks?

How to have a sharp product image?

Can I criticise the more senior developers around me for not writing clean code?

Coordinate my way to the name of the (video) game

Pulling the rope with one hand is as heavy as with two hands?



How to make a Field only accept Numbers in Magento 2


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






























    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


























      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
















      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















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 19 at 10:47









      ARUNPRABAKARAN M

      601114




      601114










      asked Apr 19 at 10:43









      Waqar AliWaqar Ali

      257




      257




















          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
            Apr 19 at 10:54











          • max_length of what?

            – Asad Khan
            Apr 19 at 10:54











          • first try this code it will only accept the numbers

            – Asad Khan
            Apr 19 at 10:55











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

            – Waqar Ali
            Apr 19 at 10:55











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

            – Waqar Ali
            Apr 19 at 10:56


















          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














            Hope it's helps



            <item name="field" xsi:type="array">
            <item name="validation" xsi:type="array">
            <!-- Classes for data validation: -->
            <item name="min_text_length" xsi:type="number">1</item>
            <item name="max_text_length" xsi:type="number">50</item>
            </item>
            </item>





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



              );













              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
                Apr 19 at 10:54











              • max_length of what?

                – Asad Khan
                Apr 19 at 10:54











              • first try this code it will only accept the numbers

                – Asad Khan
                Apr 19 at 10:55











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

                – Waqar Ali
                Apr 19 at 10:55











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

                – Waqar Ali
                Apr 19 at 10:56















              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
                Apr 19 at 10:54











              • max_length of what?

                – Asad Khan
                Apr 19 at 10:54











              • first try this code it will only accept the numbers

                – Asad Khan
                Apr 19 at 10:55











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

                – Waqar Ali
                Apr 19 at 10:55











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

                – Waqar Ali
                Apr 19 at 10:56













              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 Apr 19 at 10:53









              Asad KhanAsad Khan

              39510




              39510












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

                – Waqar Ali
                Apr 19 at 10:54











              • max_length of what?

                – Asad Khan
                Apr 19 at 10:54











              • first try this code it will only accept the numbers

                – Asad Khan
                Apr 19 at 10:55











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

                – Waqar Ali
                Apr 19 at 10:55











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

                – Waqar Ali
                Apr 19 at 10:56

















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

                – Waqar Ali
                Apr 19 at 10:54











              • max_length of what?

                – Asad Khan
                Apr 19 at 10:54











              • first try this code it will only accept the numbers

                – Asad Khan
                Apr 19 at 10:55











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

                – Waqar Ali
                Apr 19 at 10:55











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

                – Waqar Ali
                Apr 19 at 10:56
















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

              – Waqar Ali
              Apr 19 at 10:54





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

              – Waqar Ali
              Apr 19 at 10:54













              max_length of what?

              – Asad Khan
              Apr 19 at 10:54





              max_length of what?

              – Asad Khan
              Apr 19 at 10:54













              first try this code it will only accept the numbers

              – Asad Khan
              Apr 19 at 10:55





              first try this code it will only accept the numbers

              – Asad Khan
              Apr 19 at 10:55













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

              – Waqar Ali
              Apr 19 at 10:55





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

              – Waqar Ali
              Apr 19 at 10:55













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

              – Waqar Ali
              Apr 19 at 10:56





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

              – Waqar Ali
              Apr 19 at 10:56













              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 Apr 19 at 11:33









                  magefmsmagefms

                  2,8602529




                  2,8602529





















                      0














                      Hope it's helps



                      <item name="field" xsi:type="array">
                      <item name="validation" xsi:type="array">
                      <!-- Classes for data validation: -->
                      <item name="min_text_length" xsi:type="number">1</item>
                      <item name="max_text_length" xsi:type="number">50</item>
                      </item>
                      </item>





                      share|improve this answer





























                        0














                        Hope it's helps



                        <item name="field" xsi:type="array">
                        <item name="validation" xsi:type="array">
                        <!-- Classes for data validation: -->
                        <item name="min_text_length" xsi:type="number">1</item>
                        <item name="max_text_length" xsi:type="number">50</item>
                        </item>
                        </item>





                        share|improve this answer



























                          0












                          0








                          0







                          Hope it's helps



                          <item name="field" xsi:type="array">
                          <item name="validation" xsi:type="array">
                          <!-- Classes for data validation: -->
                          <item name="min_text_length" xsi:type="number">1</item>
                          <item name="max_text_length" xsi:type="number">50</item>
                          </item>
                          </item>





                          share|improve this answer















                          Hope it's helps



                          <item name="field" xsi:type="array">
                          <item name="validation" xsi:type="array">
                          <!-- Classes for data validation: -->
                          <item name="min_text_length" xsi:type="number">1</item>
                          <item name="max_text_length" xsi:type="number">50</item>
                          </item>
                          </item>






                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Apr 19 at 12:01

























                          answered Apr 19 at 11:13









                          ARUNPRABAKARAN MARUNPRABAKARAN M

                          601114




                          601114



























                              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%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

                              Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                              Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

                              What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company