Thank you for your help.
Windows, VisualStudio 2015 ASP.NET (VisualBasic), .NET Framework 4.6,
Local IIS, browsers are developed in Google Chrome, IE, and .
Put text (TextBox in ASP.NET, named txtTest) on one page and
Only backspace, tabs, front and rear arrows, and half-width numbers can be entered.
Set the function (named numOnly())
It is related to what I asked you before.
text in HTMLIf you enter only half-width numbers in onkeydown of t, the numeric keypad does not work.
I have a grammar question.
Write the HTML from the web page source as follows:
function numOnly(){
if((48<=event.keyCode)&(event.keyCode<=57){
return true;
} else{
return false;
}
}
If you write like this, you can enter only half-width numbers.
No backspaces, tabs, front and rear arrows, or half-width alphanumeric characters.
Therefore, regarding the value of event.keyCode, use the backspace = 8, tab = 9, front and rear arrows = 37 and 39, and
Rewrite as follows:
function numOnly(){
if(event.keyCode=8){
return true;
}
else if(event.keyCode=9){
return true;
}
else if (event.keyCode=37) {
return true;
}
else if(event.keyCode=39){
return true;
}
else if((48<=event.keyCode)&(event.keyCode<=57){
return true;
} else{
return false;
}
}
However, if you write like this, you can enter half-width English characters.
I don't know why.
If there is a defect in the writing method,
I would appreciate it if you could let me know.
I look forward to your kind cooperation.
javascript html css visual-studio asp.net
The conditional event.keyCode=8
is substituted (=
), so please rewrite it to equal value comparison (==
).
567 Who developed the "avformat-59.dll" that comes with FFmpeg?
577 PHP ssh2_scp_send fails to send files as intended
567 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
884 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
596 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.