Accept specific numeric value in radnumeric textbox

2 posts, 1 answers
  1. Stephen
    Stephen avatar
    4 posts
    Member since:
    Jun 2012

    Posted 27 Jun 2012 Link to this post

    Hi,

    How can i have a radnumeric textbox which accepts only digits from 0 to 5. ie.e should accept 52 but not 38.

    Thanks
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Jun 2012 Link to this post

    Hi Stephen,

    Try the following javascript to achieve your scenario.

    JS:
    <script type="text/javascript"
      function OnKeyPress(sender, args)
         {
           if (args.get_keyCode() > 53)
            {
              args.set_cancel(true);
            }
         }
    </script>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top