I want to get only positive values, is there any way to prevent it using only html
Please don't suggest validation method
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
-
Why does the box-shadow property not apply to a
Here's an angular 2 solution:
create a class OnlyNumber
add OnlyNumber to declarations in app.module.ts and use like it like this anywhere in your app
I was not satisfied with @Abhrabm answer because:
Solution is to prevent with key code:
Clarification provided by @Hugh Guiney:
What key codes are being checked:
Here is a solution that worked best of me for a QTY field that only allows numbers.
This code is working fine for me. Can you please check:
Easy method: