Linked Questions

99 votes
3 answers
629k views

How to allow only numbers to be written in this textbox ? <input type="text" class="textfield" value="" id="extra7" name="extra7">
EnexoOnoma's user avatar
  • 8,880
0 votes
2 answers
12k views

<input id='nb' name="nb" type="number" placeholder="Number"/> jQuery.val() returns the value if there are only numbers, but empty if there is any letter. Chrome shows the input number arrows (...
user2316341's user avatar
-1 votes
1 answer
10k views

When the user presses a key, I want to remove characters that are not in the range 0-9, but this code isn't working: (jsfiddle) $('input').on('keypress', function(event){ var char = String....
Jayy's user avatar
  • 14.9k
3 votes
2 answers
5k views

Possible Duplicate: How to allow only numeric (0-9) in HTML inputbox using jQuery? I have a jquery snippet which allows only numbers inside a particular textbox.If the user types a letter/special ...
karan k's user avatar
  • 977
-6 votes
1 answer
8k views

As my question says, how to prevent a user from typing non-numeric characters in the input field? Like e.g when they attempt to type alphabets or special characters, the cursor won't move at all ...
sasori's user avatar
  • 5,511
0 votes
4 answers
1k views

I have this script which only allows 0-9 and - characters for negative numbers. However this does not prevent a user from entering 123- for example and it causes errors. Is there a workaround for this?...
aozora's user avatar
  • 421
-1 votes
2 answers
1k views

Possible Duplicate: How to allow only numeric (0-9) in HTML inputbox using jQuery? how can I limit user input as user type in a text box? For example, I want to accept only a number and I want ...
Robert A Henru's user avatar
1 vote
0 answers
931 views

I'm trying to remove the ability to input persian/arabic numbers with mobile phones. Specifically (١٢٣) button in iOS. any hint is appreciated. I have already tried the pattern="[0-9]" and pattern="\...
sina farbod's user avatar
0 votes
2 answers
202 views

$('input').on("input", function() { if (isWhole($(this).val())) { return false; //$(this).removeAttr("style").removeClass("not"); } else { //$(this).css("border", "2px solid red")....
Pekka's user avatar
  • 1,115
1 vote
0 answers
241 views

I've got an input that holds a valuta number. With <input pattern="[0-9]*" /> I was able to force the numeric keyboard to show up on mobile phones. But I want to add the option to select a comma,...
Paul van den Dool's user avatar
0 votes
0 answers
81 views

Can anyone help me how to remove the last entered character from textfield. For example I have to allow only integers in the textfield. so if we enter any hyphen(-) not as first character it should ...
user1268130's user avatar
1127 votes
79 answers
2.9m views

Is there a quick way to set an HTML text input (<input type=text />) to only allow numeric keystrokes (plus '.')?
1361 votes
22 answers
959k views

Is there a consistent way across browsers to hide the new spin boxes that some browsers (such as Chrome) render for HTML input of type number? I am looking for a CSS or JavaScript method to prevent ...
Alan's user avatar
  • 13.8k
1203 votes
13 answers
1.2m views

According to html5.org, the "number" input type's "value attribute, if specified and not empty, must have a value that is a valid floating point number." Yet it is simply (in the latest version of ...
B. Clay Shannon-B. Crow Raven's user avatar
237 votes
40 answers
617k views

What is the best way to restrict "number"-only input for textboxes? I am looking for something that allows decimal points. I see a lot of examples. But have yet to decide which one to use. Update ...
wenbert's user avatar
  • 5,303

15 30 50 per page
1
2 3 4 5
9