Last post Aug 21, 2020 08:18 AM by PaulTheSmith
Aug 20, 2020 06:48 PM|sanam13|LINK
I am having one textbox in my webpage for mobile no. now i added validation that only numbers can be input in textbox but when i open my website in laptop validation works perfectly and when i open
my website in mobile alphabets numbers also get inputed.
My requirement is when i open website in mobile then also alphabets characters will be ignored.
Here is my code pls execute it.
<input type = "text" id = "Txtstyle2" placeholder="Enter Your REAL Phone No. Here..." required="required" onkeypress="isInputNumber(event)" />
var ch = String.fromCharCode(evt.which);
Aug 20, 2020 08:15 PM|bruce (sqlwork.com)|LINK
which device & browser is your test for? check
that the event, event parameters and String.fromCharCode is supported.
note: should work on iPhone
Aug 21, 2020 08:18 AM|PaulTheSmith|LINK
Have a look at https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onkeypress
In particular the large areas in red with the Deprecated heading