- Home /
How to prevent numbers in the input box and just display text?
Here i found out this one ..It works but i have no idea how it is working ..The split() method this example uses is giving me painful headache.. Do anyone have idea of how tht split() method works..Can we pass numbers as first argument to split() method?Is tht a separator ,if it is why not inclosed within quote(" ")
<script type="text/javascript">
function noNumbers(field) {
for ( var i = 0; i < 10; i++ ) {
field.value = field.value.split(i).join("");
}
}
</script>
<form>
Type some text (numbers not allowed):
<input type="text" onkeyup="noNumbers(this);" />
</form>
Duplicate Question : http://answers.unity3d.com/questions/346101/how-to-prevent-numbers-in-the-input-box-and-just-d.html
Please Delete this Question.
Please be patient if your question/reply doesn't show straight away.
As a new user, your posts and questions are held in a moderator que until it is approved and then it is displayed. When your karma rises, you'll be able to post questions, comments and answers without waiting for someone to approve it =]
Your answer
![](https://koobas.hobune.stream/wayback/20220613083646im_/https://answers.unity.com/themes/thub/images/avi.jpg)