Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Enter numbers only ??

Engaged ,
Jan 05, 2021 Jan 05, 2021

Want to enter numbers only without letters?

 

++++++++++++++++++

 

setTimeout(function () {
textinputtitle.restrict = "0-9" + "٠-٩";
dom_overlay_container.children["textinputtitle"].maxLength = 1;
what_change();
}, 0);

 

==================

2021-01-06_8-54-26.jpg

586
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 14, 2021 Jan 14, 2021

if (!this.exectedOnce) {
function inputF(e) {
if (this.num == "invalid") {
document.getElementById("textinputtitle").value = document.getElementById("textinputtitle").value.slice(0, -1)
}
}
function keyupF(e) {
if (!isNaN(e.key)) {
this.num = e.key;
} else {
this.num = "invalid";
}
}
$("#dom_overlay_container").on("input", "#textinputtitle", inputF.bind(this));
$("#dom_overlay_container").on("keydown", "#textinputtitle", keyupF.bind(this));
this.executedOnce = true;
}

Translate
Community Expert ,
Jan 06, 2021 Jan 06, 2021

why do you persist in using a textinput component?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 10, 2021 Jan 10, 2021

Because I want the user to enter a number only ??

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 11, 2021 Jan 11, 2021

??

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 14, 2021 Jan 14, 2021

?? 

setTimeout(function () {
var textinputtitle = /[^0-9]/g;
dom_overlay_container.children["textinputtitle"].maxLength = 1;
what_change();
}, 0);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 14, 2021 Jan 14, 2021

if (!this.exectedOnce) {
function inputF(e) {
if (this.num == "invalid") {
document.getElementById("textinputtitle").value = document.getElementById("textinputtitle").value.slice(0, -1)
}
}
function keyupF(e) {
if (!isNaN(e.key)) {
this.num = e.key;
} else {
this.num = "invalid";
}
}
$("#dom_overlay_container").on("input", "#textinputtitle", inputF.bind(this));
$("#dom_overlay_container").on("keydown", "#textinputtitle", keyupF.bind(this));
this.executedOnce = true;
}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 16, 2021 Jan 16, 2021

Thank you very much for your kind response (^_^) , genius ...
I wish you always happiness and ease in all your affairs .

Thanks .

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 17, 2021 Jan 17, 2021
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines