TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Check The Validation For Only Integer Number
Ghanashyam Nayak
Apr 29, 2020
4.9
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
It Will Check That Given Input Is In Integer Or Not....
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
>
<html>
<head>
<title>Sample Code</title>
<script type=
"text/javascript"
>
function
CheckInteger(b)
{
var
a = /(^-?\d\d*$)/;
if
(a.test(b))
{
alert(
'Your Given Input "'
+ b +
'" Is Correct.'
)
}
else
{
alert(
'Your Given Input"'
+ b +
'" Is Not Correct.'
)
}};
</script>
</head>
<body bgcolor=#00ff00 alink=blue vlink=blue>
<FORM name=
"windowEvent"
>
Number : <input type=
"text"
name=
"txtnumber"
/>
<input type=
"button"
value=
"Check Integer"
name=
"btnCheckInteger"
onClick=
"CheckInteger(txtnumber.value)"
/>
</FORM>
</body>
</html>
Check The Validation For Only Integer Number
Next Recommended Reading
Javascript-Check indian mobile number validation