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

Enter numbers only ??

Engaged ,
Jan 05, 2021 Jan 05, 2021

Copy link to clipboard

Copied

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

Views

305

Translate

Translate

Report

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;
}

Votes

Translate

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

Copy link to clipboard

Copied

why do you persist in using a textinput component?

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

??

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

?? 

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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;
}

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Thanks .

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

you're welcome.

Votes

Translate

Translate

Report

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