How to past in text box only 7 digits
<p>I have an HTML form in a web app for  android.
one of the fields is a text box that getting auto numbers from the location of the device.
but the problem is that I need only 7 numbers and it's pasting much more, how can I restrict this field with js and it's will paste only the first 7 numbers? I tried to do max length and js valid code, but nothing worked, it's still pasting a lot of numbers.
Thanks,
Jordan</p>
