This is a migrated thread and some comments may be shown as answers.

Accept specific numeric value in radnumeric textbox

1 Answer 25 Views
Input
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 27 Jun 2012, 09:35 AM
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

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 27 Jun 2012, 09:53 AM
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.
Tags
Input
Asked by
Stephen
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or